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 using astropy.time.Time directly.

Parameters:
gpsLIGOTimeGPS, int, float

GPS time to convert.

Returns:
datetimedatetime.datetime

UTC-aware datetime representation of the input GPS time.

Notes

Examples

>>> from_gps(1167264018)
datetime.datetime(2017, 1, 1, 0, 0)
>>> from_gps(1126259462.3910)
datetime.datetime(2015, 9, 14, 9, 50, 45, 391000)