cf.DomainAncillary.asdatetime

DomainAncillary.asdatetime(i=False)[source]

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

Only applicable to domain ancillarys 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 domain ancillary in place. By default a new domain ancillary is created. In either case, a domain ancillary is returned.

Returns:

out: cf.DomainAncillary

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