<p>Which Terrestrial Time (TT)? The International Bureau of Weights and Measures (BIPM; the acronym is French) releases updates to the relationship between TT and International Atomic Time (TAI; the acronym once again is in French)on an annual basis. Note well: These updates change both the future and past relationship between TT and TAI.</p>
<p>Fortunately, except for astronomers doing microarcsecond astronomy, these annual corrections are tiny nuances that can be ignored. They're in the range of a few tens of nanoseconds. To the microsecond level, simply use the fact that TT is constantly ahead of TAI by 32.184 seconds:
<span class="math-container">$$ T_{\text{TT}} = T_{\text{TAI}} + 32.184\,\text{s}\tag{1}$$</span></p>
<p>That's TAI, which is fairly simple. GPS time is also fairly simple because it's a fixed offset from TAI. The relation between TAI and Coordinated Universal Time (UTC; the acronym is what it is; it is neither French nor English) is not so simple. You'll have to account for leap seconds. There is no equation for the relation between TAI and UTC. You'll need a leap second table:
<span class="math-container">$$\begin{align}
T_{\text{UTC}} &amp;= T_{\text{TAI}} - \operatorname{leap}_{\text{TAI}}(T_{\text{TAI}})\quad \text{or} \\
T_{\text{TAI}} &amp;= T_{\text{UTC}} + \operatorname{leap}_{\text{UTC}}(T_{\text{UTC}}) \tag{2}
\end{align}$$</span></p>
<p>Combining equations (1) and (2) yields
<span class="math-container">$$ T_{\text{TT}} = T_{\text{UTC}} + \operatorname{leap}_{\text{UTC}}(T_{\text{UTC}}) + 32.184\,\text{s}\tag{3}$$</span></p>
<p>To build your leap second table <span class="math-container">$\operatorname{leap}_{\text{UTC}}(T_{\text{UTC}})$</span> in a pedantically correct manner means eschewing the idea that every UTC minute contains exactly 60 UTC seconds. For example, the UTC time half a second before 00:00 1 Jan 2017 UTC was 23:59:60.5 31 December 2016 UTC. Windows, Linux, Android, iOS, OS X: all of them do it wrong. Those operating systems assume every minute comprises exactly 60 seconds, and fudge things for leap second boundaries. They'll all have a complete fit if current trends continue and the first ever negative leap second is added five or six years from now.</p>

CC BY-SA 4.0
2021-12-06T15:55:07.947Z
The IETF provide a leap seconds table in a format that's relatively easy to parse. https://www.ietf.org/timezones/data/leap-seconds.list However, it uses seconds since 1900-Jan 1 00:00:00 for the epoch of its timestamps. Also, the SHA-1 hash line at the end of the file is broken into 5 groups of hex numbers *without* leading zeroes, which is slightly annoying.
PM 2Ring
CC BY-SA 4.0
2021-12-07T02:48:00.967Z
Thanks a lot for this! I am currently using CelesTrak Earth Orientation Parameters table, which conveniently provides a column with leap seconds. I am still a bit confused about the meaning of Planet Lab's "seconds since J2000 epoch Terrestrial Time". I guess the most reasonable thing would be to think they mean TT seconds since the TT J2000 epoch, but can it be completely ruled out that they actually mean UTC seconds since the TT J2000 epoch? I guess the easiest might just be email Planet Labs to ask about it
Rafa
CC BY-SA 4.0
2021-12-07T04:04:53.663Z
For future reference, I received confirmation that the epoch for Planet Labs state vectors does not include leap seconds
Rafa
CC BY-SA 4.0
2021-12-07T10:20:45.360Z
@Rafa With the introduction of the concept of leap seconds in 1972, UTC seconds and TAI seconds are by definition identically equal. For all practical purposes (except microarcsecond astronomy), TT seconds and TAI seconds are also identically equal. This means that you can consider TT seconds, TAI seconds, and UTC seconds to be one and the same thing.
David Hammen
CC BY-SA 4.0
2021-12-06T12:59:32.957Z
2021-12-06T12:59:32.957Z
David Hammen
<p><a href="https://space.stackexchange.com/questions/56058/suppose-i-wanted-to-compare-tles-to-actual-leo-satellite-positions-what-data-is">A recent question on Space Exploration</a> mentioned that Planet Labs provides public ephemerides for their satellites <a href="https://ephemerides.planet-labs.com" rel="nofollow noreferrer">here</a>. I believe this provides a very valuable resource for testing different orbital propagators.</p>
<p>However, in order to perform such tests, it is key to know to exactly what time the provided ephemerides correspond. The ephemerides by Planet Labs give the epoch in &quot;seconds since J2000 epoch Terrestrial Time&quot;. Several of us at Space Exploration are interested in converting accurately such epoch to UTC time (i.e., with at least millisecond accuracy).</p>
<p>Therefore, I was wondering if there is any specific algorithm that should be applied in order to perform such conversion? From my understanding, it would be enough to do the following:</p>
<ol>
<li>Get the J2000 epoch Terrestrial Time in UTC, which seems to be January 1st, 2000 at 11:58:55.816 (see <a href="https://en.wikipedia.org/wiki/Equinox_(celestial_coordinates)#J2000.0" rel="nofollow noreferrer">here</a>)</li>
<li>Calculate a date and time using such epoch (which is in UTC) and the provided seconds since J2000 epoch Terrestrial Time (since we are now going from seconds since epoch to a date and time, leap seconds need to be taken into account)</li>
</ol>
<p>Would this be enough to perform an accurate conversion? Or am I missing some additional steps here?</p>

CC BY-SA 4.0
2021-12-06T16:10:24.013Z
FWIW, Lick Observatory astronomer [Steve Allen](https://astronomy.stackexchange.com/users/14050/steve-allen) has a *lot* of info about [leap seconds and time scales](https://www.ucolick.org/~sla/leapsecs/) on his site.
PM 2Ring
CC BY-SA 4.0
2021-12-06T17:05:02.847Z
Here's some [Python code on Github](https://gist.github.com/PM2Ring/9dc0fa6a39dafb88b9e30f514b0dfead) that shows how to parse leap-seconds.list, with a live version linked in the comment below the program source code.
PM 2Ring
<time>
Conversion of seconds since J2000 epoch Terrestrial Time to UTC time
Rafa
# Conversion of seconds since J2000 epoch Terrestrial Time to UTC time

(Asked by: username_0 on 2021-12-06)

[A recent question on Space Exploration](https://space.stackexchange.com/questions/56058/suppose-i-wanted-to-compare-tles-to-actual-leo-satellite-positions-what-data-is) mentioned that Planet Labs provides public ephemerides for their satellites [here](https://ephemerides.planet-labs.com). I believe this provides a very valuable resource for testing different orbital propagators.

However, in order to perform such tests, it is key to know to exactly what time the provided ephemerides correspond. The ephemerides by Planet Labs give the epoch in "seconds since J2000 epoch Terrestrial Time". Several of us at Space Exploration are interested in converting accurately such epoch to UTC time (i.e., with at least millisecond accuracy).

Therefore, I was wondering if there is any specific algorithm that should be applied in order to perform such conversion? From my understanding, it would be enough to do the following:

1. Get the J2000 epoch Terrestrial Time in UTC, which seems to be January 1st, 2000 at 11:58:55.816 (see [here](https://en.wikipedia.org/wiki/Equinox_(celestial_coordinates)#J2000.0))
2. Calculate a date and time using such epoch (which is in UTC) and the provided seconds since J2000 epoch Terrestrial Time (since we are now going from seconds since epoch to a date and time, leap seconds need to be taken into account)

Would this be enough to perform an accurate conversion? Or am I missing some additional steps here?

**Tags:** time

> **Comments:**
> **username_1**: FWIW, Lick Observatory astronomer [Steve Allen](https://astronomy.stackexchange.com/users/14050/steve-allen) has a *lot* of info about [leap seconds and time scales](https://www.ucolick.org/~sla/leapsecs/) on his site.  
> **username_1**: Here's some [Python code on Github](https://gist.github.com/username_1/9dc0fa6a39dafb88b9e30f514b0dfead) that shows how to parse leap-seconds.list, with a live version linked in the comment below the program source code.  

---

## 1 answers

### Answer by username_2 on 2021-12-06. Score: 3 | Accepted answer

Which Terrestrial Time (TT)? The International Bureau of Weights and Measures (BIPM; the acronym is French) releases updates to the relationship between TT and International Atomic Time (TAI; the acronym once again is in French)on an annual basis. Note well: These updates change both the future and past relationship between TT and TAI.

Fortunately, except for astronomers doing microarcsecond astronomy, these annual corrections are tiny nuances that can be ignored. They're in the range of a few tens of nanoseconds. To the microsecond level, simply use the fact that TT is constantly ahead of TAI by 32.184 seconds:
$$ T\_{\text{TT}} = T\_{\text{TAI}} + 32.184\,\text{s}\tag{1}$$

That's TAI, which is fairly simple. GPS time is also fairly simple because it's a fixed offset from TAI. The relation between TAI and Coordinated Universal Time (UTC; the acronym is what it is; it is neither French nor English) is not so simple. You'll have to account for leap seconds. There is no equation for the relation between TAI and UTC. You'll need a leap second table:
$$\begin{align}
T\_{\text{UTC}} &= T\_{\text{TAI}} - \operatorname{leap}\_{\text{TAI}}(T\_{\text{TAI}})\quad \text{or} \\
T\_{\text{TAI}} &= T\_{\text{UTC}} + \operatorname{leap}\_{\text{UTC}}(T\_{\text{UTC}}) \tag{2}
\end{align}$$

Combining equations (1) and (2) yields
$$ T\_{\text{TT}} = T\_{\text{UTC}} + \operatorname{leap}\_{\text{UTC}}(T\_{\text{UTC}}) + 32.184\,\text{s}\tag{3}$$

To build your leap second table $\operatorname{leap}\_{\text{UTC}}(T\_{\text{UTC}})$ in a pedantically correct manner means eschewing the idea that every UTC minute contains exactly 60 UTC seconds. For example, the UTC time half a second before 00:00 1 Jan 2017 UTC was 23:59:60.5 31 December 2016 UTC. Windows, Linux, Android, iOS, OS X: all of them do it wrong. Those operating systems assume every minute comprises exactly 60 seconds, and fudge things for leap second boundaries. They'll all have a complete fit if current trends continue and the first ever negative leap second is added five or six years from now.

> **Comments:**
> **username_1**: The IETF provide a leap seconds table in a format that's relatively easy to parse. https://www.ietf.org/timezones/data/leap-seconds.list However, it uses seconds since 1900-Jan 1 00:00:00 for the epoch of its timestamps. Also, the SHA-1 hash line at the end of the file is broken into 5 groups of hex numbers *without* leading zeroes, which is slightly annoying.  
> **username_0**: Thanks a lot for this! I am currently using CelesTrak Earth Orientation Parameters table, which conveniently provides a column with leap seconds. I am still a bit confused about the meaning of Planet Lab's "seconds since J2000 epoch Terrestrial Time". I guess the most reasonable thing would be to think they mean TT seconds since the TT J2000 epoch, but can it be completely ruled out that they actually mean UTC seconds since the TT J2000 epoch? I guess the easiest might just be email Planet Labs to ask about it  
> **username_0**: For future reference, I received confirmation that the epoch for Planet Labs state vectors does not include leap seconds  
> **username_2**: @username_0 With the introduction of the concept of leap seconds in 1972, UTC seconds and TAI seconds are by definition identically equal. For all practical purposes (except microarcsecond astronomy), TT seconds and TAI seconds are also identically equal. This means that you can consider TT seconds, TAI seconds, and UTC seconds to be one and the same thing.  

---

