date_range_like(source, calendar, use_cftime=None)¶
Generate a datetime array with the same frequency, start and end as another one, but in a different calendar.
str) – New calendar name.
bool, optional) – If True, the output uses
cftime.datetimeobjects. If None (default),
numpy.datetime64values are used if possible. If False,
numpy.datetime64values are used or an error is raised.
DataArray– 1D datetime coordinate with the same start, end and frequency as the source, but in the new calendar. The start date is assumed to exist in the target calendar. If the end date doesn’t exist, the code tries 1 and 2 calendar days before. There is a special case when the source time series is daily or coarser and the end of the input range is on the last day of the month. Then the output range will also end on the last day of the month in the new calendar.