Is there any time format strictly based off of the passage of time, instead of the day night cycle?

71 Views Asked by At

So I just learned about leap seconds and at first I thought "oh, well just use the unix timestamp" then I read they based the thing off of a day being a specific amount of seconds and adjust leap seconds to keep it aligned with the sun. Da heck?!

So I guess it's no good. Is there a time format that is strictly based on the number of seconds since January first midnight 1970, or some similar anchor point in time, that doesn't try and sync up with the erratic rotation of our planet?

EDIT: motivation: Having time that is accurate regardless of time of day or timezone and that doesn't possible have an ambiguous time. Frankly I'm surprised to learn this isn't the defacto, it sounds like whoever decided adding in leap seconds, didn't consider that they were unnecessarily adding niche bugs to software.

2

There are 2 best solutions below

2
Binh Tran On

The closest ones to my knowledge are astronomy clocks such as


I feel like I should add this. These clocks are rarely useful for most daily needs. The reason is that human activity is heavily depends on sunrise-sunset cycle (even Daylight Saving cycle which has been living on long pasted its usefulness) and beyond that, most typical user thinks of "point in time" in term of "year, month, day, hour,..." and not "where is this relative to a fixed point".

So there maybe a better answer that fits your needs if you add some context to your question.

0
Matt Johnson-Pint On

You're asking about time standards. In this area, it's important to understand context about how the standard is intended to be used.

Taking your question directly, the time standard you're describing is International Atomic Time (TAI). It is the standard that all of the world's timekeeping institutions (NIST, NPL, etc.) use to coordinate their clocks. It is super useful for this purpose, as this is what it was designed for. It does not have leap seconds.

However, TAI is rarely used directly in computing or business. The only time standard that matters for most of us is Coordinated Universal Time (UTC). This is what your computer's system time tracks, and we typically synchronize to this standard using NTP. It does have leap seconds.

The PTP protocol can be used to synchronize a computer's clock to either TAI or UTC. This is because TAI is the basis, but the protocol separately carries the current offset between UTC and TAI.

Most systems don't display leap seconds. Instead, they are typically absorbed during synchronization. In other words, after a leap second occurs, a system might deviate from UTC by one second until its next synchronization. However, this behavior can vary across systems and platforms. Some may choose to display it directly. Some may "smear" out the leap second across the day.

Unix Timestamps are interesting in that they both do and do not have leap seconds, depending on how you interpret the problem. They do have leap seconds in that the timestamp is aligned to UTC, so any timestamp you interpret is inclusive of all the leap seconds that occurred to date. But they don't have leap seconds in that there is no accounting for them in the calculation. The calculation is an exact number of seconds since the Unix epoch (1970-01-01T00:00:00Z). In other words, the Unix timestamp of a leap second itself (such as 2016-12-31T23:59:60Z) is ambiguous.

Ultimately, in day-to-day computing, you probably shouldn't choose a standard other than UTC or be concerned about ambiguity of Unix Timestamp leap seconds unless you have very specific use cases where leap seconds become an issue.