Module 03 · Lesson 1
Time Scales - UTC, TAI, GPS and UT1
Space software handles several time scales that differ by whole seconds or drift apart slowly. This lesson covers TAI, UTC, GPS time, UT1, Julian dates and the pitfalls of ordinary timestamps.
Learning objectives
After this lesson you will be able to:
- Distinguish TAI, UTC, GPS time, UT1 and TT, and state the fixed and variable offsets between them
- Convert a UTC calendar date to a Julian date and explain what an epoch such as J2000.0 means
- Recognize timestamp pitfalls involving leap seconds, time zones and floating-point precision
One question, several answers
In most software a timestamp is UTC from the system clock, and that is the end of the matter. Space software cannot stop there, for two reasons.
The first is sensitivity. A satellite in low Earth orbit moves more than 7 km every second, so an error of one second in time is an error of kilometers in position.
The second is that different parts of a mission keep different time. A navigation receiver reports GPS time. Orbit calculations need a scale that never jumps. Working out where a ground station is requires a scale tied to the Earth's rotation. Operators plan in UTC. Each of these is a time scale, and converting between them correctly is a routine part of the job.
Atomic time
International Atomic Time, abbreviated TAI, is a continuous count of seconds derived from atomic clocks in laboratories around the world. It has no leap seconds and no discontinuities.
UTC and leap seconds
Coordinated Universal Time, UTC, is the basis of civil time. It ticks at the same rate as TAI but differs from it by a whole number of seconds. The difference changes when a leap second is inserted, which has been done to keep UTC within 0.9 seconds of the time defined by the Earth's rotation.
A leap second is added at the end of June or December as an extra second labeled 23:59:60. When UTC took its present form in 1972 it was 10 seconds behind TAI. Since the start of 2017 it has been 37 seconds behind, and that remains the value at the time of writing.
Leap seconds cannot be calculated. The International Earth Rotation and Reference Systems Service, the IERS, announces each one about six months ahead. Software therefore needs a table of leap seconds, and the table is data with an expiry date. In 2022 the General Conference on Weights and Measures decided to relax the 0.9 second limit by 2035. Historical data will carry leap seconds regardless.
GPS time
GPS time is the continuous scale kept by the Global Positioning System. It was set equal to UTC in January 1980, when UTC was 19 seconds behind TAI, and it has not been stepped since. GPS time is therefore always 19 seconds behind TAI, and at the time of writing it is 18 seconds ahead of UTC.
The navigation signal broadcasts the current offset from UTC, and many receivers can report either scale. An interface that says only "time" has not said enough.
UT1 and the Earth's rotation
UT1 is not kept by a clock. It is a measure of the Earth's rotation angle, expressed as a time. The Earth's rotation is slightly irregular, so UT1 has to be determined from astronomical observations. The IERS publishes the difference between UT1 and UTC, along with short-term predictions.
UT1 is the scale needed to work out which way the Earth is facing, and therefore where a ground station is relative to an orbit. A point on the equator moves at about 465 meters per second as the Earth turns, so using UTC in place of UT1 can misplace the ground by up to roughly 400 meters.
Terrestrial Time and a summary
Terrestrial Time, TT, is a uniform scale used in astronomy and in the definition of standard epochs. It is ahead of TAI by exactly 32.184 seconds.
| Scale | Continuous | Relation to TAI | Typical use |
|---|---|---|---|
| TAI | Yes | Reference | Basis for the others |
| TT | Yes | TAI + 32.184 s | Standard epochs |
| GPS time | Yes | TAI - 19 s | Navigation receivers |
| UTC | No, leap seconds | TAI - 37 s since 2017 | Operations and logs |
| UT1 | Yes, but irregular | Measured, within 0.9 s of UTC | Earth orientation |
Julian dates and epochs
Calendar arithmetic is awkward, so astronomy counts days. A Julian date is a continuous count of days and fractions of a day from a starting point several thousand years in the past. By convention a Julian date begins at noon. The Modified Julian Date subtracts 2400000.5, which gives smaller numbers and days that begin at midnight.
A Julian date is a format, not a time scale. "JD 2461000.5" is ambiguous until it is labeled as UTC, TT or another scale.
A standard reference instant is called an epoch. The most common is J2000.0, defined as Julian date 2451545.0 in Terrestrial Time, or 12:00 TT on 1 January 2000.
/** Julian date of a Gregorian calendar date and time, in the same time scale as the input. */
function julianDate(year: number, month: number, day: number,
hour = 0, minute = 0, second = 0): number {
let y = year;
let m = month;
if (m <= 2) { y -= 1; m += 12; } // treat January and February as months 13 and 14
const century = Math.floor(y / 100);
const gregorian = 2 - century + Math.floor(century / 4); // Gregorian calendar correction
const dayFraction = (hour + minute / 60 + second / 3600) / 24;
return Math.floor(365.25 * (y + 4716)) + Math.floor(30.6001 * (m + 1))
+ day + gregorian - 1524.5 + dayFraction;
}
console.log(julianDate(2000, 1, 1, 12)); // J2000.0 calendar date and time
console.log(julianDate(1970, 1, 1)); // start of the Unix epoch
const jdNow = julianDate(2026, 11, 23);
const spacingDays = 2 ** -31; // gap between adjacent 64-bit floats near 2.4 million
console.log(jdNow, jdNow + spacingDays / 4 === jdNow, `${(spacingDays * 86400e6).toFixed(1)} us`);
The output is:
2451545
2440587.5
2461367.5 true 40.2 us
Two cautions apply to this illustrative function. Given a UTC date, it returns a Julian date in UTC and assumes every day has 86,400 seconds, so it has no representation for a leap second. And J2000.0 is strictly defined in Terrestrial Time. The first line reproduces the number 2451545.0 from the calendar date, but 12:00 UTC on that day came about 64 seconds after the true J2000.0 instant, which was 11:58:55.816 UTC.
The last line shows a precision limit. Adding a quarter of the spacing changes nothing, because a 64-bit float holding a present-day Julian date cannot resolve steps finer than about 40 microseconds.
Classic software pitfalls
- Unix time ignores leap seconds. It defines every day as exactly 86,400 seconds. During a leap second the count repeats, or is deliberately smeared over several hours. Subtracting two Unix timestamps across a leap second gives an interval one second short. JavaScript's
Datebehaves the same way. - Local time zones. Store and compute in one named scale and convert only for display. Operations teams work in UTC.
- Floating-point precision. The larger the number, the coarser its resolution. Unix seconds in a 32-bit float resolve only about two minutes. Precise code uses integer counts, or splits a date into a whole part and a fraction held separately.
- Unlabeled timestamps. A number without a scale is a defect. Carry the scale in the type or the field name.
Production code should use a vetted time library with a current leap second table.
A practical example: the eighteen-second offset
A team compares the positions at which a satellite's camera took its images with the positions predicted by ground software. Every image appears displaced along the orbit by about 127 km.
The size of the error is the clue. The point beneath the satellite moves at about 7.06 km/s, and 127 divided by 7.06 is 18 seconds. The onboard computer stamps images with the time from its navigation receiver, which was configured to output GPS time. The interface document said only "timestamp in seconds", and the ground software assumed UTC.
The fix has three parts. The interface document names the scale. The ground software's timestamp type carries a scale, and conversion goes through a library with a leap second table. The regression tests include data from before 2017, when the offset was 17 seconds, so that a hard-coded 18 fails.
Time fixes when something happened. The next lesson deals with where: the reference frames in which positions are expressed.
Key takeaways
- TAI and GPS time are continuous atomic scales that differ by a fixed 19 seconds. UTC runs at the same rate but is stepped by leap seconds.
- TAI minus UTC has been 37 seconds since the start of 2017, so GPS time is 18 seconds ahead of UTC at the time of writing.
- UT1 follows the Earth's actual rotation and is needed to find where the ground is. It is measured, not computed, and is published by the IERS.
- Unix time ignores leap seconds, so label every timestamp with its time scale and use a vetted library for conversions.
Knowledge check
Check your understanding. These questions are not graded and you can retry as often as you like.
0 of 3 questions answered.
Glossary
TAI
International Atomic Time. A continuous time scale built from atomic clocks around the world, with no leap seconds.
UTC
Coordinated Universal Time. The basis of civil time. It ticks at the same rate as TAI but is offset from it by a whole number of seconds that changes when a leap second is inserted.
Leap second
A one-second adjustment applied to UTC to keep it within 0.9 seconds of UT1. Leap seconds are announced by the IERS.
UT1
A time scale defined by the Earth's rotation angle. It is determined from observations and cannot be predicted exactly.
Julian date
A continuous count of days and fractions of a day, used to avoid calendar arithmetic. A Julian date begins at noon.
J2000.0
A standard reference epoch, Julian date 2451545.0 in Terrestrial Time, which is 12:00 TT on 1 January 2000.
References and further reading
- IERS Bulletins (opens in a new tab)International Earth Rotation and Reference Systems Service
- Leap Second and UT1-UTC Information (opens in a new tab)National Institute of Standards and Technology
- Time Metrology (opens in a new tab)Bureau International des Poids et Mesures
Finished this lesson?
Loading your progress…
Lesson version 1.0.0.