drms.to_datetime

drms.to_datetime(tstr, force=False)

Parse JSOC time strings.

In general, this is quite complicated, because of the many different (non-standard) time strings supported by the DRMS. For more (much more!) details on this matter, see Rick Bogart’s notes.

The current implementation only tries to convert typical HMI time strings, with a format like “%Y.%m.%d_%H:%M:%S_TAI”, to an ISO time string, that is then parsed by pandas. Note that “_TAI”, aswell as other timezone indentifiers like “Z”, will not be taken into account, so the result will be a naive timestamp without any associated timezone.

If you know the time string format, it might be better calling pandas.to_datetime() directly. For handling TAI timestamps, e.g. converting between TAI and UTC, the astropy.time package can be used.

Parameters:
tstr : string or list/Series of strings

DateTime strings.

force : bool

Set to True to omit the endswith(‘_TAI’) check.

Returns:
result : pandas.Series or pandas.Timestamp

Pandas series or a single Timestamp object.