Epoch

Class to handle time.

pymeeus.Epoch.DAY2HOURS = 24.0

Number of hours per day

pymeeus.Epoch.DAY2MIN = 1440.0

Number of minutes per day

pymeeus.Epoch.DAY2SEC = 86400.0

Number of seconds per day

class pymeeus.Epoch.Epoch(*args, **kwargs)[source]

Class Epoch deals with the tasks related to time handling.

The constructor takes either a single JDE value, or a series of values representing year, month, day, hours, minutes, seconds. This series of values is supposed to be in UTC time (civil time). It is also possible to provide another Epoch object as input of the constructor.

When a UTC time is provided, it is converted to International Atomic Time (TAI) using an internal table of leap seconds, and from there, it is converted to (and stored as) Terrestrial Time (TT). Given that leap seconds are added or subtracted in an irregular basis, it is not possible to predict them in advance, and the internal leap second table will become outdated at some point in time. To counter this, you have two options:

  • Download an updated version of this Pymeeus package.
  • Use the argument leap_seconds in the constructor or set() method to provide the correct number of leap seconds (w.r.t. TAI) to be applied.

For instance, if at some time in the future the TAI-UTC difference is 43 seconds, you should set leap_seconds=43 if you don’t have an updated version of this class.

In order to know which is the most updated leap second value stored in this class, you may use the get_last_leap_second() method.

The UTC to TT correction is done by default, but you may disable it by setting leap_seconds=0. In that case, it is supposed that the input data is already in TT scale.

Note

As said above, UTC to TT correction is done by default, but the current version of UTC was implemented in January 1st, 1972. Therefore, for dates before the correction in NOT carried out, and it is supposed that the input data is already in TT scale.

Note

For conversions between TT and Universal Time (UT), please use the method tt2ut().

Note

Internally, time values are stored as a Julian Ephemeris Day (JDE), based on the uniform scale of Dynamical Time, or morei specifically, Terrestial Time (TT) (itself the redefinition of Terrestrial Dynamical Time, TDT).

Note

The UTC-TT conversion is composed of three corrections:

  1. TT-TAI, composed of 32.184 s,
  2. TAI-UTC(1972), 10 s, and
  3. UTC(1972)-UTC(Now)

which is the current amount of leap seconds. When you do, for instance, leap_seconds=43, you modify the c. part, while when you do leap_seconds=0.0, you disable the three corrections.

Note

Given that this class stores the epoch as JDE, if the JDE value is in the order of millions of days then, for a computer with 15-digit accuracy, the final time resolution is about 10 milliseconds. That is considered enough for most applications of this class.

__add__(b)[source]

This method defines the addition between an Epoch and some days.

Parameters:b (int, float) – Value to be added, in days.
Returns:A new Epoch object.
Return type:Epoch
Raises:TypeError if operand is of wrong type.
>>> a = Epoch(1991, 7, 11)
>>> b = a + 10000
>>> y, m, d = b.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
2018/11/26.0
__call__()[source]

Method used when Epoch is called only with parenthesis.

Returns:The internal value of the Julian Ephemeris Day.
Return type:float
>>> a = Epoch(-122, 1, 1.0, leap_seconds=0.0)
>>> print(a())
1676497.5
__eq__(b)[source]

This method defines the ‘is equal’ operator between Epochs.

Note

For the comparison, the base.TOL value is used.

Returns:A boolean.
Return type:bool
Raises:TypeError if input values are of wrong type.
>>> a = Epoch(2007, 5, 20.0)
>>> b = Epoch(2007, 5, 20.000001)
>>> a == b
False
>>> a = Epoch(2004, 10, 15.7)
>>> b = Epoch(a)
>>> a == b
True
>>> a = Epoch(2434923.85)
>>> a == 2434923.85
True
__float__()[source]

This method returns the internal JDE value as a float.

Returns:Internal JDE value as a float.
Return type:float
>>> a = Epoch(2434923.85)
>>> float(a)
2434923.85
__ge__(b)[source]

This method defines ‘is equal or greater’ operator between Epochs.

Returns:A boolean.
Return type:bool
Raises:TypeError if input values are of wrong type.
>>> a = Epoch(2004, 10, 15.71)
>>> b = Epoch(2004, 10, 15.7)
>>> a >= b
True
__gt__(b)[source]

This method defines the ‘is greater than’ operator between Epochs.

Returns:A boolean.
Return type:bool
Raises:TypeError if input values are of wrong type.
>>> a = Epoch(2004, 10, 15.71)
>>> b = Epoch(2004, 10, 15.7)
>>> a > b
True
>>> a = Epoch(-207, 11, 5.2)
>>> b = Epoch(-207, 11, 5.2)
>>> a > b
False
__iadd__(b)[source]

This method defines the accumulative addition to this Epoch.

Parameters:b (int, float) – Value to be added, in days.
Returns:This Epoch.
Return type:Epoch
Raises:TypeError if operand is of wrong type.
>>> a = Epoch(2003, 12, 31.0)
>>> a += 32.5
>>> y, m, d = a.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
2004/2/1.5
__init__(*args, **kwargs)[source]

Epoch constructor.

This constructor takes either a single JDE value, or a series of values representing year, month, day, hours, minutes, seconds. This series of values is supposed to be in UTC time (civil time).

It is also possible to provide another Epoch object as input for the constructor, or the year, month, etc. arguments can be provided in a tuple or list. Moreover, it is also possible provide date or datetime objects for initialization.

The month value can be provided as an integer (1 = January, 2 = February, etc), or it can be provided as short (Jan, Feb, …) or long (January, February, …) names. Also, hours, minutes, seconds can be provided separately, or as decimals of the day value.

If leap_seconds argument is set to a value different than zero, then that value will be used for the UTC->TAI conversion, and the internal leap seconds table will be bypassed. On the other hand, if it is set to zero, then the UTC to TT correction is disabled, and it is supposed that the input data is already in TT scale.

Parameters:
  • *args (int, float, Epoch, tuple, list, date, datetime) – Either JDE, Epoch, date, datetime or year, month, day, hours, minutes, seconds values, by themselves or inside a tuple or list
  • leap_seconds (int, float) – If different from zero, this is the value to be used in the UTC->TAI conversion. If equals to zero, conversion is disabled.
Returns:

Epoch object.

Return type:

Epoch

Raises:

ValueError if input values are in the wrong range.

Raises:

TypeError if input values are of wrong type.

>>> e = Epoch(1987, 6, 19.5, leap_seconds=0.0)
>>> print(e)
2446966.0
__int__()[source]

This method returns the internal JDE value as an int.

Returns:Internal JDE value as an int.
Return type:int
>>> a = Epoch(2434923.85)
>>> int(a)
2434923
__isub__(b)[source]

This method defines the accumulative subtraction to this Epoch.

Parameters:b (int, float) – Value to be subtracted, in days.
Returns:This Epoch.
Return type:Epoch
Raises:TypeError if operand is of wrong type.
>>> a = Epoch(2001, 12, 31.0)
>>> a -= 2*365
>>> y, m, d = a.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
2000/1/1.0
__le__(b)[source]

This method defines ‘is equal or less’ operator between Epochs.

Returns:A boolean.
Return type:bool
Raises:TypeError if input values are of wrong type.
>>> a = Epoch(2004, 10, 15.71)
>>> b = Epoch(2004, 10, 15.7)
>>> a <= b
False
>>> a = Epoch(-207, 11, 5.2)
>>> b = Epoch(-207, 11, 5.2)
>>> a <= b
True
__lt__(b)[source]

This method defines the ‘is less than’ operator between Epochs.

Returns:A boolean.
Return type:bool
Raises:TypeError if input values are of wrong type.
>>> a = Epoch(2004, 10, 15.7)
>>> b = Epoch(2004, 10, 15.7)
>>> a < b
False
__ne__(b)[source]

This method defines the ‘is not equal’ operator between Epochs.

Note

For the comparison, the base.TOL value is used.

Returns:A boolean.
Return type:bool
>>> a = Epoch(2007, 5, 20.0)
>>> b = Epoch(2007, 5, 20.000001)
>>> a != b
True
>>> a = Epoch(2004, 10, 15.7)
>>> b = Epoch(a)
>>> a != b
False
>>> a = Epoch(2434923.85)
>>> a != 2434923.85
False
__radd__(b)[source]

This method defines the addition to a Epoch by the right

Parameters:b (int, float) – Value to be added, in days.
Returns:A new Epoch object.
Return type:Epoch
Raises:TypeError if operand is of wrong type.
>>> a = Epoch(2004, 2, 27.8)
>>> b = 2.2 + a
>>> y, m, d = b.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
2004/3/1.0
__str__()[source]

Method used when trying to print the object.

Returns:Internal JDE value as a string.
Return type:string
>>> e = Epoch(1987, 6, 19.5, leap_seconds=0.0)
>>> print(e)
2446966.0
__sub__(b)[source]

This method defines the subtraction between Epochs or between an Epoch and a given number of days.

Parameters:b (py:class:Epoch, int, float) – Value to be subtracted, either an Epoch or days.
Returns:A new Epoch object if parameter ‘b’ is in days, or the difference between provided Epochs, in days.
Return type:Epoch, float
Raises:TypeError if operand is of wrong type.
>>> a = Epoch(1986, 2, 9.0)
>>> print(round(a(), 2))
2446470.5
>>> b = Epoch(1910, 4, 20.0)
>>> print(round(b(), 2))
2418781.5
>>> c = a - b
>>> print(round(c, 2))
27689.0
>>> a = Epoch(2003, 12, 31.0)
>>> b = a - 365.5
>>> y, m, d = b.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
2002/12/30.5
__weakref__

list of weak references to the object (if defined)

dow(as_string=False)[source]

Method to return the day of week corresponding to this Epoch.

By default, this method returns an integer value: 0 for Sunday, 1 for Monday, etc. However, when as_string=True is passed, the names of the days are returned.

Parameters:as_string (bool) – Whether result will be given as a integer or as a string. False by default.
Returns:Day of the week, as a integer or as a string.
Return type:int, str
>>> e = Epoch(1954, 'June', 30)
>>> e.dow()
3
>>> e = Epoch(2018, 'Feb', 14.9)
>>> e.dow(as_string=True)
'Wednesday'
>>> e = Epoch(2018, 'Feb', 15)
>>> e.dow(as_string=True)
'Thursday'
>>> e = Epoch(2018, 'Feb', 15.99)
>>> e.dow(as_string=True)
'Thursday'
>>> e.set(2018, 'Jul', 15.4)
>>> e.dow(as_string=True)
'Sunday'
>>> e.set(2018, 'Jul', 15.9)
>>> e.dow(as_string=True)
'Sunday'
static doy2date(year, doy)[source]

This method takes a year and a Day Of Year values, and returns the corresponding date.

Parameters:
  • year (int, float) – Year, in four digits format
  • doy (int, float) – Day of Year number
Returns:

Year, month, day.

Return type:

tuple

Raises:

ValueError if either input year or doy values are invalid.

>>> t = Epoch.doy2date(1999, 29)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
1999/1/29.0
>>> t = Epoch.doy2date(2017, 365.7)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
2017/12/31.7
>>> t = Epoch.doy2date(2012, 63.1)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
2012/3/3.1
>>> t = Epoch.doy2date(-1004, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-1004/2/29.0
>>> t = Epoch.doy2date(0, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
0/2/29.0
>>> t = Epoch.doy2date(1, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
1/3/1.0
>>> t = Epoch.doy2date(-1, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-1/3/1.0
>>> t = Epoch.doy2date(-2, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-2/3/1.0
>>> t = Epoch.doy2date(-3, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-3/3/1.0
>>> t = Epoch.doy2date(-4, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-4/2/29.0
>>> t = Epoch.doy2date(-5, 60)
>>> print("{}/{}/{}".format(t[0], t[1], round(t[2], 1)))
-5/3/1.0
static easter(year)[source]

Method to return the Easter day for given year.

Note

This method is valid for both Gregorian and Julian years.

Parameters:year (int) – Year
Returns:Easter month and day, as a tuple
Return type:tuple
Raises:TypeError if input values are of wrong type.
>>> Epoch.easter(1991)
(3, 31)
>>> Epoch.easter(1818)
(3, 22)
>>> Epoch.easter(1943)
(4, 25)
>>> Epoch.easter(2000)
(4, 23)
>>> Epoch.easter(1954)
(4, 18)
>>> Epoch.easter(179)
(4, 12)
>>> Epoch.easter(1243)
(4, 12)
static getDOY(YYYY, MM, DD)[source]

This method returns the Day Of Year (DOY) for the given date.

Parameters:
  • YYYY (int, float) – Year, in four digits format
  • MM (int, float) – Month, in numeric format (1 = January, 2 = February, etc)
  • DD (int, float) – Day, in numeric format
Returns:

Day Of Year (DOY).

Return type:

float

Raises:

ValueError if input values correspond to a wrong date.

>>> Epoch.getDOY(1999, 1, 29)
29.0
>>> Epoch.getDOY(1978, 11, 14)
318.0
>>> Epoch.getDOY(2017, 12, 31.7)
365.7
>>> Epoch.getDOY(2012, 3, 3.1)
63.1
>>> Epoch.getDOY(-400, 2, 29.9)
60.9
get_date(**kwargs)[source]

This method converts the internal JDE value back to a date.

Use leap_seconds=0.0 to disable the automatic TT to UTC conversion mechanism, or provide a non zero value to leap_seconds to apply a specific leap seconds value.

Parameters:leap_seconds (int, float) – Optional value for leap seconds.
Returns:Year, month, day in a tuple
Return type:tuple
>>> e = Epoch(2436116.31)
>>> y, m, d = e.get_date(leap_seconds=0.0)
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
1957/10/4.81
>>> e = Epoch(1988, 1, 27)
>>> y, m, d = e.get_date()
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
1988/1/27.0
>>> e = Epoch(1842713.0)
>>> y, m, d = e.get_date(leap_seconds=0.0)
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
333/1/27.5
>>> e = Epoch(1507900.13)
>>> y, m, d = e.get_date(leap_seconds=0.0)
>>> print("{}/{}/{}".format(y, m, round(d, 2)))
-584/5/28.63
static get_last_leap_second()[source]

Method to get the date and value of the last leap second added to the table

Returns:Tuple with year, month, day, leap second value.
Return type:tuple
static get_month(month, as_string=False)[source]

Method to get the month as a integer in the [1, 12] range, or as a full name.

Parameters:
  • month (int, float, str) – Month, in numeric, short name or long name format
  • as_string (bool) – Whether the output will be numeric, or a long name.
Returns:

Month as integer in the [1, 12] range, or as a long name.

Return type:

int, str

Raises:

ValueError if input month value is invalid.

>>> Epoch.get_month(4.0)
4
>>> Epoch.get_month('Oct')
10
>>> Epoch.get_month('FEB')
2
>>> Epoch.get_month('August')
8
>>> Epoch.get_month('NOVEMBER')
11
>>> Epoch.get_month(9.0, as_string=True)
'September'
>>> Epoch.get_month('Feb', as_string=True)
'February'
>>> Epoch.get_month('March', as_string=True)
'March'
static gregorian2moslem(year, month, day)[source]

Method to convert a date in the Gregorian (or Julian) calendar to the Moslen calendar.

Parameters:
  • year (int) – Year
  • month (int) – Month
  • day (int) – Day
Returns:

Date in Moslem calendar: year, month and day, as a tuple

Return type:

tuple

Raises:

TypeError if input values are of wrong type.

>>> Epoch.gregorian2moslem(1991, 8, 13)
(1412, 2, 2)
static is_julian(year, month, day)[source]

This method returns True if given date is in the Julian calendar.

Parameters:
  • year – Year
  • month – Month
  • day (int) – Day
Returns:

Whether the provided date belongs to Julian calendar or not.

Return type:

bool

>>> Epoch.is_julian(1997, 5, 27.1)
False
>>> Epoch.is_julian(1397, 7, 7.0)
True
static is_leap(year)[source]

Method to check if a given year is a leap year.

Parameters:year (int, float) – Year to be checked.
Returns:Whether or not year is a leap year.
Return type:bool
Raises:ValueError if input year value is invalid.
>>> Epoch.is_leap(2003)
False
>>> Epoch.is_leap(2012)
True
>>> Epoch.is_leap(1900)
False
>>> Epoch.is_leap(-1000)
True
>>> Epoch.is_leap(1000)
True
jde()[source]

Method to return the internal value of the Julian Ephemeris Day.

Returns:The internal value of the Julian Ephemeris Day.
Return type:float
>>> a = Epoch(-1000, 2, 29.0, leap_seconds=0.0)
>>> print(a.jde())
1355866.5
static jewish_pesach(year)[source]

Method to return the Jewish Easter (Pesach) day for given year.

Note

This method is valid for both Gregorian and Julian years.

Parameters:year (int) – Year
Returns:Jewish Easter (Pesach) month and day, as a tuple
Return type:tuple
Raises:TypeError if input values are of wrong type.
>>> Epoch.jewish_pesach(1990)
(4, 10)
static leap_seconds(year, month)[source]

Returns the leap seconds accumulated for the given year and month.

Parameters:
  • year (int) – Year
  • month (int) – Month, in numeric format ([1:12] range)
Returns:

Leap seconds accumulated for given year and month.

Return type:

int

>>> Epoch.leap_seconds(1972, 4)
0
>>> Epoch.leap_seconds(1972, 6)
0
>>> Epoch.leap_seconds(1972, 7)
1
>>> Epoch.leap_seconds(1983, 6)
11
>>> Epoch.leap_seconds(1983, 7)
12
>>> Epoch.leap_seconds(1985, 8)
13
>>> Epoch.leap_seconds(2016, 11)
26
>>> Epoch.leap_seconds(2017, 1)
27
>>> Epoch.leap_seconds(2018, 7)
27
mjd()[source]

This method returns the Modified Julian Day (MJD).

Returns:Modified Julian Day (MJD).
Return type:float
>>> e = Epoch(1858, 'NOVEMBER', 17, leap_seconds=0.0)
>>> e.mjd()
0.0
static moslem2gregorian(year, month, day)[source]

Method to convert a date in the Moslen calendar to the Gregorian (or Julian) calendar.

Note

This method is valid for both Gregorian and Julian years.

Parameters:
  • year (int) – Year
  • month (int) – Month
  • day (int) – Day
Returns:

Date in Gregorian (Julian) calendar: year, month and day, as a tuple

Return type:

tuple

Raises:

TypeError if input values are of wrong type.

>>> Epoch.moslem2gregorian(1421, 1, 1)
(2000, 4, 6)
set(*args, **kwargs)[source]

Method used to set the value of this object.

This method takes either a single JDE value, or a series of values representing year, month, day, hours, minutes, seconds. This series of values is supposed to be in UTC time (civil time).

It is also possible to provide another Epoch object as input for the set() method, or the year, month, etc arguments can be provided in a tuple or list. Moreover, it is also possible provide date or datetime objects for initialization.

The month value can be provided as an integer (1 = January, 2 = February, etc), or it can be provided as short (Jan, Feb, …) or long (January, February, …) names. Also, hours, minutes, seconds can be provided separately, or as decimals of the day value.

If leap_seconds argument is set to a value different than zero, then that value will be used for the UTC->TAI conversion, and the internal leap seconds table will be bypassed. On the other hand, if it is set to zero, then the UTC to TT correction is disabled, and it is supposed that the input data is already in TT scale.

Note

The UTC to TT correction is only carried out for dates after January 1st, 1972.

Parameters:
  • *args (int, float, Epoch, tuple, list, date, datetime) – Either JDE, Epoch, date, datetime or year, month, day, hours, minutes, seconds values, by themselves or inside a tuple or list
  • leap_seconds (int, float) – If different from zero, this is the value to be used in the UTC->TAI conversion. If equals to zero, conversion is disabled. If not given, UTC to TT conversion is carried out (default).
Returns:

None.

Return type:

None

Raises:

ValueError if input values are in the wrong range.

Raises:

TypeError if input values are of wrong type.

>>> e = Epoch()
>>> e.set(1987, 6, 19.5, leap_seconds=0.0)
>>> print(e)
2446966.0
>>> e.set(1977, 'Apr', 26.4, leap_seconds=0.0)
>>> print(e)
2443259.9
>>> e.set(1957, 'October', 4.81, leap_seconds=0.0)
>>> print(e)
2436116.31
>>> e.set(333, 'Jan', 27, 12, leap_seconds=0.0)
>>> print(e)
1842713.0
>>> e.set(1900, 'Jan', 1, leap_seconds=0.0)
>>> print(e)
2415020.5
>>> e.set(-1001, 'august', 17.9, leap_seconds=0.0)
>>> print(e)
1355671.4
>>> e.set(-4712, 1, 1.5, leap_seconds=0.0)
>>> print(e)
0.0
>>> e.set((1600, 12, 31), leap_seconds=0.0)
>>> print(e)
2305812.5
>>> e.set([1988, 'JUN', 19, 12], leap_seconds=0.0)
>>> print(e)
2447332.0
>>> d = datetime.date(2000, 1, 1)
>>> e.set(d, leap_seconds=0.0)
>>> print(e)
2451544.5
>>> e.set(837, 'Apr', 10, 7, 12, leap_seconds=0.0)
>>> print(e)
2026871.8
>>> d = datetime.datetime(837, 4, 10, 7, 12, 0, 0)
>>> e.set(d, leap_seconds=0.0)
>>> print(e)
2026871.8
sidereal_time()[source]

Method to compute the _mean_ sidereal time at Greenwich for the epoch represented by this object.

Note

If you require the result as an angle, you should convert the result from this method to hours with decimals (with DAY2HOURS), and then multiply by 15 deg/hr. Alternatively, you can convert the result to hours with decimals, and feed this value to an Angle object, setting ra=True, and making use of Angle facilities for further handling.

Returns:Mean sidereal time, in days
Return type:float
>>> e = Epoch(1987, 4, 10, leap_seconds=0.0)
>>> round(e.sidereal_time(), 9)
0.549147764
>>> e = Epoch(1987, 4, 10, 19, 21, 0.0, leap_seconds=0.0)
>>> round(e.sidereal_time(), 9)
0.357605204
static tt2ut(year, month)[source]

This method provides an approximation of the difference, in seconds, between Terrestrial Time and Universal Time, denoted DeltaT, where: DeltaT = TT - UT.

Here we depart from Meeus book and use the polynomial expressions from:

https://eclipse.gsfc.nasa.gov/LEcat5/deltatpoly.html

Which are regarded as more elaborate and precise than Meeus’.

Please note that, by definition, the UTC time used internally in this Epoch class by default is kept within 0.9 seconds from UT. Therefore, UTC is in itself a quite good approximation to UT, arguably better than some of the results provided by this method.

Parameters:
  • year (int, float) – Year we want to compute DeltaT for.
  • month (int, float) – Month we want to compute DeltaT for.
Returns:

DeltaT, in seconds

Return type:

float

>>> round(Epoch.tt2ut(1642, 1), 1)
62.1
>>> round(Epoch.tt2ut(1680, 1), 1)
15.3
>>> round(Epoch.tt2ut(1700, 1), 1)
8.8
>>> round(Epoch.tt2ut(1726, 1), 1)
10.9
>>> round(Epoch.tt2ut(1750, 1), 1)
13.4
>>> round(Epoch.tt2ut(1774, 1), 1)
16.7
>>> round(Epoch.tt2ut(1800, 1), 1)
13.7
>>> round(Epoch.tt2ut(1820, 1), 1)
11.9
>>> round(Epoch.tt2ut(1890, 1), 1)
-6.1
>>> round(Epoch.tt2ut(1928, 2), 1)
24.2
>>> round(Epoch.tt2ut(1977, 2), 1)
47.7
>>> round(Epoch.tt2ut(1998, 1), 1)
63.0
>>> round(Epoch.tt2ut(2015, 7), 1)
69.3
static utc2local()[source]

Method to return the difference between UTC and local time.

By default, dates in this Epoch class are handled in Coordinated Universal Time (UTC). This method provides you the seconds that you have to add or subtract to UTC time to convert to your local time.

Please bear in mind that, in order for this method to work, you operative system must be correctly configured, with the right time and corresponding time zone.

Returns:Difference in seconds between local and UTC time.
Return type:float
pymeeus.Epoch.LEAP_TABLE = {1972.5: 1, 1973.0: 2, 1974.0: 3, 1975.0: 4, 1976.0: 5, 1977.0: 6, 1978.0: 7, 1979.0: 8, 1980.0: 9, 1981.5: 10, 1982.5: 11, 1983.5: 12, 1985.5: 13, 1988.0: 14, 1990.0: 15, 1991.0: 16, 1992.5: 17, 1993.5: 18, 1994.5: 19, 1996.0: 20, 1997.5: 21, 1999.0: 22, 2006.0: 23, 2009.0: 24, 2012.5: 25, 2015.5: 26, 2017.0: 27}

This table represents the point in time FROM WHERE the given number of leap seconds is valid. Given that leap seconds are (so far) always added at June 30th or December 31st, a leap second added in 1997/06/30 is represented here as ‘1997.5’, while a leap second added in 2005/12/31 appears here as ‘2006.0’.