from_gps#
- gwpy.time.from_gps(gps: SupportsFloat) datetime[source]#
Convert a GPS time into a
datetime.datetime.Warning
This method cannot convert exact leap seconds to
datetime.datetime, that object doesn’t support it, so you should consider usingastropy.time.Timedirectly.- Parameters:
- gps
LIGOTimeGPS,int,float GPS time to convert.
- gps
- Returns:
- datetime
datetime.datetime UTC-aware
datetimerepresentation of the input GPS time.
- datetime
Notes
All
datetimeobjects returned by this function are ‘aware’ in the UTC timezone. For more details on timezone handling indatetimeobjects, see Aware and naive objects.
Examples
>>> from_gps(1167264018) datetime.datetime(2017, 1, 1, 0, 0) >>> from_gps(1126259462.3910) datetime.datetime(2015, 9, 14, 9, 50, 45, 391000)