cf.DimensionCoordinate.asdatetime

DimensionCoordinate.asdatetime(i=False)

Convert the internal representation of data array elements to date-time objects.

Only applicable to dimension coordinates with reference time units.

If the calendar has not been set then the CF default calendar will be used and the units will be updated accordingly.

See also

asreftime

Examples 1:
>>> g = f.asdatetime()
Parameters:
i : bool, optional

If True then update the dimension coordinate in place. By default a new dimension coordinate is created. In either case, a dimension coordinate is returned.

Returns:

out : cf.DimensionCoordinate

Examples 2:
>>> t.asreftime().dtype
dtype('float64')
>>> t.asdatetime().dtype
dtype('O')