Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Unix time
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==== Variant that counts leap seconds ==== Another, much rarer, non-conforming variant of Unix time keeping involves incrementing the value for all seconds, including leap seconds;<ref>{{cite web|url=https://www.iana.org/time-zones/repository/tz-link.html#precision|work=Sources for time zone and daylight saving time data|title=Precision timekeeping|quote=The tz code and data support leap seconds via an optional "right" configuration where a computer's internal time_t integer clock counts every TAI second, as opposed to the default "posix" configuration where the internal clock ignores leap seconds. The two configurations agree for timestamps starting with 1972-01-01 00:00:00 UTC (time_t 63β072β000) and diverge for timestamps starting with time_t 78β796β800, which corresponds to the first leap second 1972-06-30 23:59:60 UTC in the "right" configuration, and to 1972-07-01 00:00:00 UTC in the "posix" configuration.|access-date=30 May 2022|archive-date=16 October 2017|archive-url=https://web.archive.org/web/20171016230241/http://www.iana.org/time-zones/repository/tz-link.html#precision|url-status=live}}</ref> some Linux systems are configured this way.<ref name="ntp-time-scales">{{cite web|title=Time Scales|url=https://support.ntp.org/bin/view/Support/TimeScales|work=Network Time Protocol Wiki|date=24 July 2019|access-date=12 January 2020|archive-date=12 January 2020|archive-url=https://web.archive.org/web/20200112103701/https://support.ntp.org/bin/view/Support/TimeScales|url-status=live}}</ref> Time kept in this fashion is sometimes referred to as "TAI" (although timestamps can be converted to UTC if the value corresponds to a time when the difference between TAI and UTC is known), as opposed to "UTC" (although not all UTC time values have a unique reference in systems that do not count leap seconds).<ref name="ntp-time-scales" /> Because TAI has no leap seconds, and every TAI day is exactly 86400 seconds long, this encoding is actually a pure linear count of seconds elapsed since 1970-01-01T00:00:10{{nbsp}}TAI. This makes time interval arithmetic much easier. Time values from these systems do not suffer the ambiguity that strictly conforming POSIX systems or NTP-driven systems have. In these systems it is necessary to consult a table of leap seconds to correctly convert between UTC and the pseudo-Unix-time representation. This resembles the manner in which time zone tables must be consulted to convert to and from [[civil time]]; the [[IANA time zone database]] includes leap second information, and the sample code available from the same source uses that information to convert between TAI-based timestamps and local time. Conversion also runs into definitional problems prior to the 1972 commencement of the current form of UTC (see section [[#UTC basis|UTC basis]] below). This system, despite its superficial resemblance, is not Unix time. It encodes times with values that differ by several seconds from the POSIX time values. A version of this system, in which the epoch was 1970-01-01T00:00:00{{nbsp}}TAI rather than 1970-01-01T00:00:10{{nbsp}}TAI, was proposed for inclusion in ISO C's [[C date and time functions|{{code|time.h}}]], but only the UTC part was accepted in 2011.<ref>{{cite web |author=Markus Kuhn |title=Modernized API for ISO C |url=https://www.cl.cam.ac.uk/~mgk25/time/c/ |website=www.cl.cam.ac.uk |access-date=31 August 2020 |archive-date=26 September 2020 |archive-url=https://web.archive.org/web/20200926224028/https://www.cl.cam.ac.uk/~mgk25/time/c/ |url-status=live }}</ref> A {{code|tai_clock}} does, however, exist in C++20.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)