propensive / aviation

Representations of time, in its various forms, for Scala
https://propensive.com/temporaneous
1 stars 0 forks source link

Provide different interpretations of `Instant`s #16

Open propensive opened 1 year ago

propensive commented 1 year ago

Leap seconds cause all kinds of problems.

UNIX time increases by 86400 seconds every day, even on days when there is a leap second. On these days, the same numerical time can ambiguously represent distinct times (one second apart). This can affect calculations involving durations which span leap seconds.

Conversely, TAI does account for leap seconds.

I think that internally representing an Instant as TAI or UNIX time are both viable, and new instances of Instants in either representation could be constructed from UNIX timestamps or TAI timestamps, potentially raising ambiguity issues.

propensive commented 1 year ago

TaiInstant has been provided in addition to Instant.