@@ -506,6 +506,7 @@ def open_zarr(
506
506
consolidated = False ,
507
507
overwrite_encoded_chunks = False ,
508
508
decode_timedelta = None ,
509
+ use_cftime = None ,
509
510
** kwargs ,
510
511
):
511
512
"""Load and decode a dataset from a Zarr store.
@@ -570,6 +571,16 @@ def open_zarr(
570
571
{'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds'}
571
572
into timedelta objects. If False, leave them encoded as numbers.
572
573
If None (default), assume the same value of decode_time.
574
+ use_cftime: bool, optional
575
+ Only relevant if encoded dates come from a standard calendar
576
+ (e.g. "gregorian", "proleptic_gregorian", "standard", or not
577
+ specified). If None (default), attempt to decode times to
578
+ ``np.datetime64[ns]`` objects; if this is not possible, decode times to
579
+ ``cftime.datetime`` objects. If True, always decode times to
580
+ ``cftime.datetime`` objects, regardless of whether or not they can be
581
+ represented using ``np.datetime64[ns]`` objects. If False, always
582
+ decode times to ``np.datetime64[ns]`` objects; if this is not possible
583
+ raise an error.
573
584
574
585
Returns
575
586
-------
@@ -631,6 +642,7 @@ def maybe_decode_store(store, lock=False):
631
642
decode_coords = decode_coords ,
632
643
drop_variables = drop_variables ,
633
644
decode_timedelta = decode_timedelta ,
645
+ use_cftime = use_cftime
634
646
)
635
647
636
648
# TODO: this is where we would apply caching
0 commit comments