astropy.time Package#



If the current ERFA leap second table is out of date, try to update it.



Warning for leap second when converting to datetime.datetime object.


Configuration parameters for astropy.time.

OperandTypeError(left, right[, op])


Time(val[, val2, format, scale, precision, ...])

Represent and manipulate times and dates for astronomy.


Base time class from which Time and TimeDelta inherit.

TimeBesselianEpoch(val1, val2, scale, ...[, ...])

Besselian Epoch year as value(s) like 1950.0.

TimeBesselianEpochString(val1, val2, scale, ...)

Besselian Epoch year as string value(s) like 'B1950.0'.

TimeCxcSec(val1, val2, scale, precision, ...)

Chandra X-ray Center seconds from 1998-01-01 00:00:00 TT.

TimeDatetime(val1, val2, scale, precision, ...)

Represent date as Python standard library datetime object.

TimeDatetime64(val1, val2, scale, precision, ...)

TimeDecimalYear(val1, val2, scale, ...[, ...])

Time as a decimal year, with integer values corresponding to midnight of the first day of each year.

TimeDelta(val[, val2, format, scale, ...])

Represent the time difference between two times.

TimeDeltaDatetime(val1, val2, scale, ...[, ...])

Time delta in datetime.timedelta.

TimeDeltaFormat(val1, val2, scale, ...[, ...])

Base class for time delta representations.

TimeDeltaJD(val1, val2, scale, precision, ...)

Time delta in Julian days (86400 SI seconds).


Warning for missing unit or format in TimeDelta.

TimeDeltaNumeric(val1, val2, scale, ...[, ...])

TimeDeltaQuantityString(val1, val2, scale, ...)

Time delta as a string with one or more Quantity components.

TimeDeltaSec(val1, val2, scale, precision, ...)

Time delta in SI seconds.

TimeEpochDate(val1, val2, scale, precision, ...)

Base class for support of Besselian and Julian epoch dates.

TimeEpochDateString(val1, val2, scale, ...)

Base class to support string Besselian and Julian epoch dates such as 'B1950.0' or 'J2000.0' respectively.

TimeFITS(val1, val2, scale, precision, ...)

FITS format: "[±Y]YYYY-MM-DD[THH:MM:SS[.sss]]".

TimeFormat(val1, val2, scale, precision, ...)

Base class for time representations.

TimeFromEpoch(val1, val2, scale, precision, ...)

Base class for times that represent the interval from a particular epoch as a numerical multiple of a unit time interval (e.g. seconds or days).

TimeGPS(val1, val2, scale, precision, ...[, ...])

GPS time: seconds from 1980-01-06 00:00:00 UTC For example, 630720013.0 is midnight on January 1, 2000.

TimeISO(val1, val2, scale, precision, ...[, ...])

ISO 8601 compliant date-time format "YYYY-MM-DD HH:MM:SS.sss...".

TimeISOT(val1, val2, scale, precision, ...)

ISO 8601 compliant date-time format "YYYY-MM-DDTHH:MM:SS.sss...".


Container for meta information like name, description, format.


Container for meta information like name, description, format.

TimeJD(val1, val2, scale, precision, ...[, ...])

Julian Date time format.

TimeJulianEpoch(val1, val2, scale, ...[, ...])

Julian Epoch year as value(s) like 2000.0.

TimeJulianEpochString(val1, val2, scale, ...)

Julian Epoch year as string value(s) like 'J2000.0'.

TimeMJD(val1, val2, scale, precision, ...[, ...])

Modified Julian Date time format.

TimeNumeric(val1, val2, scale, precision, ...)

TimePlotDate(val1, val2, scale, precision, ...)

Matplotlib plot_date input: 1 + number of days from 0001-01-01 00:00:00 UTC.

TimeString(val1, val2, scale, precision, ...)

Base class for string-like time representations.

TimeUnique(val1, val2, scale, precision, ...)

Base class for time formats that can uniquely create a time object without requiring an explicit format specifier.

TimeUnix(val1, val2, scale, precision, ...)

Unix time (UTC): seconds from 1970-01-01 00:00:00 UTC, ignoring leap seconds.

TimeUnixTai(val1, val2, scale, precision, ...)

Unix time (TAI): SI seconds elapsed since 1970-01-01 00:00:00 TAI (see caveats).

TimeYMDHMS(val1, val2, scale, precision, ...)

ymdhms: A Time format to represent Time as year, month, day, hour, minute, second (thus the name ymdhms).

TimeYearDayTime(val1, val2, scale, ...[, ...])

Year, day-of-year and time as "YYYY:DOY:HH:MM:SS.sss...".

TimezoneInfo([utc_offset, dst, tzname])

Subclass of the tzinfo object, used in the to_datetime method to specify timezones.

Class Inheritance Diagram#

Inheritance diagram of astropy.time.formats.AstropyDatetimeLeapSecondWarning, astropy.time.Conf, astropy.time.core.OperandTypeError, astropy.time.core.ScaleValueError, astropy.time.core.Time, astropy.time.core.TimeBase, astropy.time.formats.TimeBesselianEpoch, astropy.time.formats.TimeBesselianEpochString, astropy.time.formats.TimeCxcSec, astropy.time.formats.TimeDatetime, astropy.time.formats.TimeDatetime64, astropy.time.formats.TimeDecimalYear, astropy.time.core.TimeDelta, astropy.time.formats.TimeDeltaDatetime, astropy.time.formats.TimeDeltaFormat, astropy.time.formats.TimeDeltaJD, astropy.time.core.TimeDeltaMissingUnitWarning, astropy.time.formats.TimeDeltaNumeric, astropy.time.formats.TimeDeltaQuantityString, astropy.time.formats.TimeDeltaSec, astropy.time.formats.TimeEpochDate, astropy.time.formats.TimeEpochDateString, astropy.time.formats.TimeFITS, astropy.time.formats.TimeFormat, astropy.time.formats.TimeFromEpoch, astropy.time.formats.TimeGPS, astropy.time.formats.TimeISO, astropy.time.formats.TimeISOT, astropy.time.core.TimeInfo, astropy.time.core.TimeInfoBase, astropy.time.formats.TimeJD, astropy.time.formats.TimeJulianEpoch, astropy.time.formats.TimeJulianEpochString, astropy.time.formats.TimeMJD, astropy.time.formats.TimeNumeric, astropy.time.formats.TimePlotDate, astropy.time.formats.TimeString, astropy.time.formats.TimeUnique, astropy.time.formats.TimeUnix, astropy.time.formats.TimeUnixTai, astropy.time.formats.TimeYMDHMS, astropy.time.formats.TimeYearDayTime, astropy.time.formats.TimezoneInfo