Search This Blog

Monday, September 7, 2020

Long Now Foundation

From Wikipedia, the free encyclopedia
 
The Long Now Foundation
2006-08-15 - United States - California - San Francisco - Sign - Long Now.jpg
FoundedJanuary 4, 1996; 24 years ago
Type501(c)(3)
68-0384748
Registration no.C1956835
Location
Coordinates37.8064591°N 122.4321258°WCoordinates: 37.8064591°N 122.4321258°W
Key people
President Stewart Brand, Brian Eno
Websitelongnow.org

The Long Now Foundation, established in 1996, is an American public non-profit organization based in San Francisco that seeks to start and promote a long-term cultural institution. It aims to provide a counterpoint to what it views as today's "faster/cheaper" mindset and to promote "slower/better" thinking. The Long Now Foundation hopes to "creatively foster responsibility" in the framework of the next 10,000 years. In a manner somewhat similar to the Holocene calendar, the foundation uses 5-digit dates to address the Year 10,000 problem (e.g., by writing the current year "02020" rather than "2020"). The organisation's logo is X, a capital X with an overline, a representation of 10,000 in Roman numerals.

Brian Eno, Danny Hillis, and Stewart Brand speaking at "The Long Now, now" – an event in January 2014 at the Palace of Fine Arts in San Francisco.

Projects

The foundation has several ongoing projects, including a 10,000-year clock known as the Clock of the Long Now, the Rosetta Project, the Long Bet Project, the open source Timeline Tool (also known as Longviewer), the Long Server and a monthly seminar series.

Clock of the Long Now

The purpose of the Clock of the Long Now is to construct a timepiece that will operate with minimum human intervention for ten millennia. It is to be constructed of durable materials, to be easy to repair, and to be made of largely valueless materials in case knowledge of the clock is lost or it is deemed to be of no value to an individual or possible future civilization; in this way it is hoped that the Clock will not be looted or destroyed. Its power source (or sources) should be renewable but similarly unlootable. A prototype of a potential final clock candidate was activated on December 31, 1999, and is currently on display at the Science Museum in London. The Foundation is currently building the Clock of the Long Now in Van Horn, Texas. The project has no expected completion date. "If it's finished in my lifetime we're doing it wrong," said project director Alexander Rose.

Rosetta Project

The Rosetta Project is an effort to preserve all languages that have a high likelihood of extinction over the period from 2000 to 2100. These include many languages whose native speakers number in the thousands or fewer. Other languages with many more speakers are considered by the project to be endangered because of the increasing importance of English as an international language of commerce and culture. Samples of such languages are to be inscribed onto a disc of nickel alloy three inches (7.62 cm) across. A Version 1.0 of the disc was completed on November 3, 2008.

Long Bet Project

The Long Bet Project was created by The Long Now Foundation to propose and keep track of bets on long-term events and stimulate discussion about the future. The Long Now Foundation describes The Long Bet Project as a "public arena for enjoyably competitive predictions, of interest to society, with philanthropic money at stake." One example bet would be on whether people will regularly fly on pilotless aircraft by 2030. 

Bets that were resolved in 2010 included predictions about peak oil, print on demand, modem obsolescence, and commercially available 100-qubit quantum computers.

An analysis by researcher Gwern Branwen found dozens of bets that had already expired but had not resolved, and many others with poorly defined resolution criteria. Branwen also found that the vast majority of the expired predictions resolved false, so that anyone could make a profit by betting indiscriminately against existing predictions. In light of these and other issues, and the website’s extremely low activity levels (with an average of less than two bets per year), Branwen concluded that the Long Bet Project should be shut down.

Seminars about long-term thinking

In November 2003, The Long Now Foundation began a series of monthly seminars about long-term thinking (SALT) with a lecture by Brian Eno. The seminars are held in the San Francisco Bay Area and have focused on long-term policy and thinking, scenario planning, singularity and the projects of the foundation. The seminars are available for download in various formats from The Long Now Foundation. They are intended to "nudge civilization toward making long-term thinking automatic and common". Topics have included preserving environmental resources, the deep past and deep future of the sciences and the arts, human life extension, the likelihood of an asteroid strike in the future, SETI, and the nature of time.

Long Now Foundation debate format

As part of the seminar series, there are occasionally debates on areas of long term concern, such as synthetic biology or "historian vs futurist on human progress".

The point of Long Now debates is not win-lose. The point is public clarity and deep understanding, leading to action graced with nuance and built-in adaptivity, with long-term responsibility in mind.

In operation, "There are two debaters, Alice and Bob. Alice takes the podium, makes her argument. Then Bob takes her place, but before he can present his counter-argument, he must summarize Alice's argument to her satisfaction — a demonstration of respect and good faith. Only when Alice agrees that Bob has got it right is he permitted to proceed with his own argument — and then, when he's finished, Alice must summarize it to his satisfaction."

Mutual understanding is enforced by a reciprocal requirement to describe the other's argument to their satisfaction, with the goal being more understanding after the event than there was beforehand.

The Interval

The Interval bar in Fort Mason, San Francisco
 
Opened in June 2014, The Interval was designed as social space in the foundation's Fort Mason facility in San Francisco. The purpose of The Interval is to have a public space where people can come together to discuss ideas and topics related to long-term thinking, as well as provide a venue for a variety of Long Now events. The Interval includes lounge furniture, artifacts from the foundation's projects, a library, audio/video equipment, and a bar serving tea and coffee during the day, and cocktails during the night. In October 2014 The Interval was named by Thrillist as one of the best new bars in America.

PanLex

PanLex is a linguistic project whose stated mission is to overcome language barriers to human rights, information, and opportunities. Started in 2004 at the University of Washington’s Turing Center, the project sought to build software that would enable all humans to use their native language to share information, ideas, and emotions with the rest of the world. This research produced a lexical database (TransGraph) designed to support panlingual translation, and a more powerful extension of it (PanDictionary) based on intelligent automated inference. After this work demonstrated the feasibility of the concept, the PanDictionary became the PanLex Database, and PanLex has continued to enlarge, enrich, and modify it by consulting multilingual dictionary and dictionary-like sources. In 2012, PanLex became a project of The Long Now Foundation.

In popular culture

Neal Stephenson's science fiction novel Anathem was partly inspired by the author's involvement with the Clock of the Long Now project. As a result of Brian Eno's work on the clock project, an album entitled January 07003 / Bell Studies for The Clock of The Long Now was released in 2003. English songwriter Owen Tromans released a single entitled "Long Now", inspired by the foundation, in 2013.

Board members

The Board of Directors of The Long Now Foundation as of February 2020:

Time formatting and storage bugs

From Wikipedia, the free encyclopedia
 
In computer science, time formatting and storage bugs are a class of software bugs which may cause time and date calculation or display to be improperly handled. These are most commonly manifestations of arithmetic overflow, but can also be the result of other issues. The most well-known consequence of bugs of this type is the Y2K problem, but many other milestone dates or times exist that have caused or will cause problems depending on various programming deficiencies.

Year 1970

During the 1960s, some computer programs were written using just a single digit for the year, so that 0–9 represented the years 1960–1969. It was especially easy to write programs in the COBOL language with this limitation. While many companies identified this problem in advance, some did not and outages occurred when the decade rolled over. The fix generally was to expand the year to just two digits, owing to limitations of the storage media common in that era, tab cards and magnetic tape.

Year 1975

On 4 January 1975, the 12-bit field that had been used for dates in the Decsystem 10 operating systems overflowed. There were numerous problems and crashes related to this bug while an alternative format was developed.

Year 1977

The PDP-8's OS/8 operating system used
  • 4 bits for the month
  • 5 bits for the date therein
  • 3 bits for the year.
This was recognized when COS-310 was developed, and dates were recorded differently.

Year 1989

Some mainframe programs were written to encode dates as the number of days since a 'zero date' of 1 January 1900, storing them as signed 16-bit binary integers. On 18 September 1989, these programs began to fail, the date being exactly 32,768 (215) days since the zero date. Values on and after this day do not fit into a signed 16-bit integer, but overflow and return negative values.

Year 1997

The Domain/OS clock, which is based on the number of 4-microsecond units that has occurred since 1 January 1980, rolled past 47 bits on 2 November 1997, rendering unpatched systems unusable.

Year 1999

In the last few months before the year 2000, two other date-related milestones occurred that received less publicity than the then-impending Y2K problem.

First GPS rollover

GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.

9/9/99

In many programs or data sets, "9/9/99" was used as a rogue value to indicate either an unresolved date or as a terminator to indicate no further data was in the set. This raised issues upon the arrival of the actual date this represents, 9 September 1999.

Year 2000

Two-digit year representations

Follow-on problems caused by certain temporary fixes to the Y2K problem will crop up at various points in the 21st century. Some programs were made Y2K-compliant by continuing to use two digit years, but picking an arbitrary year prior to which those years are interpreted as 20xx, and after which are interpreted as 19xx.

For example, a program may have been changed so that it treats two-digit year values 00–68 as referring to 2000 through 2068, and values 69–99 as referring to 1969 through 1999. Such a program will not be able to correctly deal with years beyond 2068.

For applications required to calculate the birth year (or another past year), such an algorithm has long been used to overcome the Year 1900 problem, but it has failed to recognise people over 100 years old.

Year 2010

Some systems had problems once the year rolled over to 2010. This was dubbed by some in the media as the "Y2K+10" or "Y2.01k" problem.

The main source of problems was confusion between hexadecimal number encoding and BCD encodings of numbers. The numbers 0 through 9 are encoded in both hexadecimal and BCD as 0016 through 0916. But the decimal number 10 is encoded in hexadecimal as 0A16 and in BCD as 1016. Thus a BCD 1016 interpreted as a hexadecimal encoding erroneously represents the decimal number 16.

For example, the SMS protocol uses BCD encoding for dates, so some mobile phone software incorrectly reported dates of messages as 2016 instead of 2010. Windows Mobile was the first software reported to have been affected by this glitch; in some cases WM6 changed the date of any incoming SMS message sent after 1 January 2010 from the year 2010 to 2016.

Other systems affected include EFTPOS terminals, and the PlayStation 3 (except the Slim model).

The most important such glitch occurred in Germany, where upwards of 20 million bank cards became unusable, and with Citibank Belgium, whose digipass customer identification chips stopped working.

Year 2011

Taiwan officially uses the Minguo calendar, which considers the Gregorian year 1912 to be its year 1. Thus, the Gregorian year 2011 is the ROC year 100, its first 3-digit year.

Year 2013

The unmanned Deep Impact spaceprobe lost communication with Earth on 11 August 2013, after a clock counted 232 deciseconds (tenths of seconds) since 1 January 2000.

Year 2019

Second GPS rollover

GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.

Japanese calendar transition

On 30 April 2019, Emperor Akihito of Japan abdicated favoring his son Naruhito. As years in Japan are traditionally referred to by era names that correspond to the reign of each emperor, this resulted in a new era name, Reiwa (令和), following Naruhito's accession to the throne the following day. Because the previous emperor, Hirohito, died in 1989 and Akihito's reign mostly corresponded with the rise in the use of computers, most software had not been tested to ensure correct behavior on an era change. Furthermore, testing was complicated by the fact that the new era name was not revealed until April 1, 2019. Therefore, errors were expected from software that did not anticipate a new era.

Classic Mac OS

The control panel in Classic Mac OS versions 6, 7, and 8 only allows the date to be set as high as December 31, 2019, although the system is able to continue to advance time beyond that date.

Year 2020

WWE 2K20 and Star Wars Jedi: Fallen Order would both crash on January 1, 2020, when the year rolled over. The glitches could only be circumvented by resetting the year back to 2019 until a patch was released. Additionally, Crystal Reports 8.5 would fail to generate specific reports starting in 2020.

Parkeon parking meters in New York City and other locations were unable to accept credit cards as a form of payment starting in 2020. A workaround was implemented, but required each meter to be individually updated. In New York, the meters were not expected to be fixed until January 9th.

In Poland, 5,000 cash registers stopped printing the date out properly.

SUUNTO sport smart watches showed out an error in computing week days, that was presented with a +2 step (aka: FRI rather WED, SAT rather than THU). For SUUNTO Spartan model watches, bug was fixed with firmware release 2.8.32.

Year 2028

During the late 1970s, on Data General Nova and Eclipse systems, World Computer Corporation (doing credit union applications) created this date format;
16-bit date field:
  • 128 years = 7 bits (1900+128=2028)
  • 12 months = 4 bits
  • 31 days = 5 bits
Dates were directly comparable using unsigned functions.
No known instances of this format are in use today.

Year 2031

Palm OS uses both signed integers with the 1970 epoch, as well as unsigned integers with the 1904 epoch, for different system functions, such as for system clock, and file dates (see PDB format). While this should result in Palm OS being susceptible to the 2038 problem, Palm OS also uses a 7-bit field for storing the year value, with a different epoch counting from 1904, resulting in a maximum year of (1904+127) 2031.

Year 2036

The Network Time Protocol has an overflow issue related to the Year 2038 problem, which manifests itself at 06:28:16 UTC on 7 February 2036, rather than 2038. The 64-bit timestamps used by NTP consist of a 32-bit part for seconds and a 32-bit part for fractional second, giving NTP a time scale that rolls over every 232 seconds (136 years) and a theoretical resolution of 2−32 second (233 picoseconds). NTP uses an epoch of 1 January 1900. The first rollover occurs in 2036, prior to the UNIX year 2038 problem.

Year 2038

Unix time rollover

The original implementation of the Unix operating system stored system time as a 32-bit signed integer representing the number of seconds past the Unix epoch: midnight UTC, 1 January 1970. This value will roll over on 19 January 2038. This problem has been addressed in most modern Unix and Unix-like operating systems by storing system time as a 64-bit signed integer, although individual applications, protocols, and file formats will still need to be changed as well.

DVB rollover

The Digital Video Broadcast system has an issue on 22 April 2038, when the 16 bits used to transmit Modified Julian Days used for electronic guide scheduling will restart from zero. The ETSI EN 300 368 specification mentions in Annex C that the provided MJD formulas are valid until 28 February 2100, but makes no mention of the limits imposed by the 16 bits used to transmit the resulting value.

Third GPS rollover

GPS dates are expressed as a week number and a day-of-week number, with the week number transmitted as a ten-bit value. This means that every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), the date resets again to that date; this happened for the first time at 23:59:47 on Saturday 21 August 1999, the second time at 23:59:42 UTC on 6 April 2019, and will happen again on 20 November 2038. To address this concern, modernised GPS navigation messages use a 13-bit field, which only repeats every 8,192 weeks (157 years), and will not return to zero until near the year 2137.

Year 2040

Early Apple Macintosh computers store time in their real-time clocks (RTCs) and HFS filesystems as an unsigned 32-bit number of seconds since 00:00:00 on 1 January 1904. After 06:28:15 on 6 February 2040, this will wrap around to 1904. HFS+, the default format for all of Apple's recent Macintosh computers, is also affected. The replacement Apple File System resolves this issue. 

ProDOS for the Apple II computers only supports two-digit year numbers. To avoid Y2K issues, Apple issued a technical note stating that the year number was to represent 1940-2039. Software for the platform may incorrectly display dates beginning in 2040. A third-party effort is underway to update ProDOS and application software to support years up to 2924.

Year 2042

On 18 September 2042, the Time of Day Clock (TODC) on the S/370 IBM mainframe and its successors, including the current zSeries, will roll over. The UTC time will be a few seconds earlier, due to leap seconds.

Older TODCs were implemented as a 64-bit count of 2−12 microsecond (0.244 ns) units, and the standard base was 1 January 1900 UT. In July 1999 the extended TODC clock was announced, which extended the clock to the right (that is, the extended bits are less significant than the original bits). The actual resolution depends on the model, but the format is consistent, and will, therefore, roll over after 252 microseconds.

The TODC value is accessible to user mode programs and is often used for timing and for generating unique IDs for events. 

While IBM has defined and implemented a longer (128-bit) hardware format on recent machines, which extends the timer on both ends by at least 8 additional bits, many programs continue to rely on the 64-bit format which remains as an accessible subset of the longer timer.

Year 2048

The ATSC system will have an issue similar to the DVB issue described above after 2048 due to its use of signed 32-bit GPS seconds that begin from 6 January 1980. 

The capacity planning logic in the ERP system SAP S/4HANA supports only finish dates up to 19 January 2048 (24855 days from 1 January 1980). This concerns e.g. the production, maintenance and inspection planning.

Year 2050

Various Texas Instruments calculators of the TI BA II Plus, TI BA II Plus Professional, TI-83, TI-84 and NSpire families support a function named dbd to calculate the number of days between dates. This function accepts dates between 1950-01-01 and 2049-12-31 only. One potential area where this will start causing problems in 2020 is in the calculation of 30-year mortgages.

Year 2079

Days 32,768 and 65,536

Programs that store dates as the number of days since an arbitrary date (or epoch) are vulnerable to roll-over or wrap-around effects if the values are not wide enough to allow the date values to span a large enough time range expected for the application. Signed 16-bit binary values roll over after 32,768 (215) days from the epoch date, producing negative values. Some mainframe systems experienced software failures because they had encoded dates as the number of days since 1 January 1900, which produced unexpected negative day numbers on the roll-over date of 18 September 1989. Similarly, unsigned 16-bit binary days counts overflow after 65,536 (216) days, which are truncated to zero values. For software using an epoch of 1 January 1900, this will occur on 6 June 2079.

Year 2080

Some (if not all) Nokia phones that run Series 40 (such as the Nokia X2-00) only supports dates up to 2079-12-31 and will refuse to change dates further than 2079-12-31. The workaround is to use the year 1996 in lieu of 2080 as a compatible leap year to display the correct day of the week, date and month on the main screen. 

Systems storing the year as a two-digit value 00..99 internally only (like many RTCs) may rollover from 2079-12-31 to the IBM PC and DOS epoch of 1980-01-01.

Year 2100

DOS and Windows file date API and conversion functions (such as INT 21h/AH=2Ah) officially support dates up to 2099-12-31 only (even though the underlying FAT filesystem would theoretically support dates up to 2107). Hence, DOS-based operating systems as well as applications that convert other formats to the FAT/DOS format, may show unexpected behavior starting 2100-01-01.

Another problem will emerge at the end of 2100-02-28, since 2100 is not a leap year, whereas many common implementations of the leap year algorithm are incomplete or simplified, and thus will erroneously assume it to be a leap year. This would cause the date to incorrectly roll over from 2100-02-28 to 2100-02-29, instead of directly to 2100-03-01.

Year 2106

Many existing file formats, communications protocols, and application interfaces employ a variant of the Unix time_t date format, storing the number of seconds since the Unix Epoch (midnight UTC, 1 January 1970) as an unsigned 32-bit binary integer. This value will roll over on 7 February 2106 at 06:28:15. That is, at this time the number of seconds since 01 January 1970 is FFFF FFFF in hex.

(This storage representation problem is independent of programs that internally store and operate on system times as 64-bit signed integer values.)

Year 2108

The date timestamps stored in FAT filesystems, originally introduced with 86-DOS 0.42 in 1981 and carried over into MS-DOS, PC DOS, DR-DOS etc., will overflow at the end of 2107-12-31. The last modification date stamp (and with DELWATCH 2.0+ also the file deletion date stamp, and since DOS 7.0+ optionally also the last access date stamp and creation date stamp), are stored in the directory entry with the year represented as an unsigned seven bit number (0–127), relative to 1980, and thereby unable to indicate any dates in the year 2108 and beyond. The API functions defined to retrieve these dates officially only support dates up to 2099-12-31. This will also affect the Zip archive file format, as it uses FAT file modification timestamps internally.

Year 2137

GPS dates are expressed as a week number and a day-of-week number, with the week number initially using a ten-bit value and modernised GPS navigation messages using a 13-bit field. Ten bit systems would rollover every 1024 weeks (about 19.6 years) after Sunday 6 January 1980 (the GPS epoch), and 13 bit systems rollover every 8192 weeks. 13 bit systems will rollover to zero in 2137.

Year 2262

The Go programming language has a UnixNano API that counts nanoseconds since 1970 as a 64-bit signed integer. This value will overflow on 2262-04-11. This is a limitation of similar nanosecond timekeeping systems, such as the Timestamp object in Python pandas, C++ chrono::system_clock or the QEMU timers.

Year 4501

Microsoft Outlook uses the date January 1, 4501 as a placeholder for "none" or "empty".

Year 10,000

The year 10,000 will be the first Gregorian year with five digits. Although many people at first consider this year to be so far distant that a problem of this type will never actually occur, certain classes of calculations in disciplines such as astronomy and physics already need to work with years of this magnitude and greater. These applications also have to deal with the Year zero problem. All future powers of 10 years have the potential for similar problems.

Year 30,828

Beginning 14 September 30,828, Windows will not accept dates beyond this day and on startup, Windows will complain about "invalid system time". This is because the FILETIME value in Windows, which is a 64-bit value corresponding to the number of 100-nanosecond intervals since 1 January 1601, 00:00:00.0000000 UTC, will overflow its maximum possible value on that day at 02:48:05.4775808 UTC.

Years 32,768 and 65,536

Programs that process years as 16-bit values may encounter problems dealing with either the year 32,768 or 65,536, depending on whether the value is treated as a signed or unsigned integer.

For the year 32,768 problem, years after 32,767 may be interpreted as negative numbers, beginning with −32,768. The year 65,536 problem is more likely to manifest itself by representing the year 65,536 as the year 0.

Relative time overflow

Microsoft

In Microsoft Windows 7, Windows Server 2003, Windows Server 2008 and Windows Vista, TCP connection start information was stored in 1/100ths of a second, using a 32bit unsigned integer, causing an overflow and TCP connections to fail after 497 days.

Boeing

The Boeing 787 aircraft has had at least two software issues related to time storage. In 2015 an error was reported where time was stored in 1/100ths of a second, using a signed 32-bit integer, and the systems would crash after 248 days. In 2020, the FAA issued an airworthiness directive for a problem where, if the aircraft is not powered down completely before reaching 51 days of uptime, systems will begin to display misleading data.

Far-fetched problems

Certain problematic years occur so far in the future, well beyond the likely lifespan of the Earth, the Sun, humanity, and even past some predictions of the lifetime of the universe, that they are mainly referenced as matters of theoretical interest, jokes, or indications that a related problem is not truly solved for any reasonable definition of “solved”.
  • The year 292,277,026,596 (2.9×1011) and 584,554,051,223 (5.8×1011) problems: the years that 64-bit Unix time becomes negative (assuming a signed number) or reset to zero (for an unsigned representation). The year 5,391,559,471,918,239,497,011,222,876,596 (5.4×1030) and 10,783,118,943,836,478,994,022,445,751,223 (1.1×1031) problems: the years that 128-bit Unix time becomes negative (assuming a signed number) or reset to zero (for an unsigned representation).
Note: these year values are based on an average year of exactly 365.2425 days, which matches the 4/100/400 leap year rules of the commonly used Gregorian calendar. Additional adjustments to the calendar over intervals this long are unavoidable, as the actual year is currently slightly shorter (about 365.242374 days) than assumed, the length of Earth's orbit around the Sun changes over time (tropical years are currently becoming shorter at about 0.53 seconds per century), and in any case, all of these times far exceed the likely existence of the Earth. So the year numbers should be considered approximate.

Time zone and daylight saving time

Time zones and daylight saving time can cause trouble in computer applications when:
  • Communicating between places with different time zones or using the same device in a different time zone
  • Daylight saving time starts and ends, especially in the fall when the same time occurs twice
  • The time zone in a specific area changes or daylight saving time is adjusted, especially when there isn't enough time for software and firmware to be updated accordingly
  • The time shifts less or more than 1 hour forward in the spring
  • The start/end dates of summer time depend on other astronomical events
  • Daylight saving time is not adopted by everyone in the same place

Unix time

From Wikipedia, the free encyclopedia
 
Unix time passed 1000000000 seconds on 2001-09-09T01:46:40Z. It was celebrated in Copenhagen, Denmark at a party held by DKUUG (at 03:46:40 local time).
 
Unix time (also known as Epoch time, POSIX time, seconds since the Epoch, or UNIX Epoch time) is a system for describing a point in time. It is the number of seconds that have elapsed since the Unix epoch, minus leap seconds; the Unix epoch is 00:00:00 UTC on 1 January 1970. Leap seconds are ignored, with a leap second having the same Unix time as the second before it, and every day is treated as if it contains exactly 86400 seconds. Due to this treatment, Unix time is not a true representation of UTC. 

Unix time is widely used in operating systems and file formats. In Unix-like operating systems, date is a command which will print or set the current time; by default, it prints or sets the time in the system time zone, but with the -u flag, it prints or sets the time in UTC and, with the TZ environment variable set to refer to a particular time zone, prints or sets the time in that time zone.

Definition

Two layers of encoding make up Unix time. The first layer encodes a point in time as a scalar real number which represents the number of seconds that have passed since 00:00:00 UTC Thursday, 1 January 1970. The second layer encodes that number as a sequence of bits or decimal digits.

As is standard with UTC, this article labels days using the Gregorian calendar, and counts times within each day in hours, minutes, and seconds. Some of the examples also show International Atomic Time (TAI), another time scheme which uses the same seconds and is displayed in the same format as UTC, but in which every day is exactly 86400 seconds long, gradually losing synchronization with the Earth's rotation at a rate of roughly one second per year.

Encoding time as a number

Unix time is a single signed number that increments every second, which makes it easier for computers to store and manipulate than conventional date systems. Interpreter programs can then convert it to a human-readable format.

The Unix epoch is the time 00:00:00 UTC on 1 January 1970. There is a problem with this definition, in that UTC did not exist in its current form until 1972; this issue is discussed below. For brevity, the remainder of this section uses ISO 8601 date and time format, in which the Unix epoch is 1970-01-01T00:00:00Z.

The Unix time number is zero at the Unix epoch, and increases by exactly 86400 per day since the epoch. Thus 2004-09-16T00:00:00Z, 12677 days after the epoch, is represented by the Unix time number 12677 × 86400 = 1095292800. This can be extended backwards from the epoch too, using negative numbers; thus 1957-10-04T00:00:00Z, 4472 days before the epoch, is represented by the Unix time number −4472 × 86400 = −386380800. This applies within days as well; the time number at any given time of a day is the number of seconds that has passed since the midnight starting that day added to the time number of that midnight. 

Because Unix time is based on an epoch, and because of a common misunderstanding that the Unix epoch is the only epoch (often called "the Epoch"), Unix time is sometimes referred to as Epoch time.

Leap seconds

The above scheme means that on a normal UTC day, which has a duration of 86400 seconds, the Unix time number changes in a continuous manner across midnight. For example, at the end of the day used in the examples above, the time representations progress as follows:

Unix time across midnight into 17 September 2004 (no leap second)
TAI (17 September 2004) UTC (16 to 17 September 2004) Unix time
2004-09-17T00:00:30.75 2004-09-16T23:59:58.75 1095379198.75
2004-09-17T00:00:31.00 2004-09-16T23:59:59.00 1095379199.00
2004-09-17T00:00:31.25 2004-09-16T23:59:59.25 1095379199.25
2004-09-17T00:00:31.50 2004-09-16T23:59:59.50 1095379199.50
2004-09-17T00:00:31.75 2004-09-16T23:59:59.75 1095379199.75
2004-09-17T00:00:32.00 2004-09-17T00:00:00.00 1095379200.00
2004-09-17T00:00:32.25 2004-09-17T00:00:00.25 1095379200.25
2004-09-17T00:00:32.50 2004-09-17T00:00:00.50 1095379200.50
2004-09-17T00:00:32.75 2004-09-17T00:00:00.75 1095379200.75
2004-09-17T00:00:33.00 2004-09-17T00:00:01.00 1095379201.00
2004-09-17T00:00:33.25 2004-09-17T00:00:01.25 1095379201.25

When a leap second occurs, the UTC day is not exactly 86400 seconds long and the Unix time number (which always increases by exactly 86400 each day) experiences a discontinuity. Leap seconds may be positive or negative. No negative leap second has ever been declared, but if one were to be, then at the end of a day with a negative leap second, the Unix time number would jump up by 1 to the start of the next day. During a positive leap second at the end of a day, which occurs about every year and a half on average, the Unix time number increases continuously into the next day during the leap second and then at the end of the leap second jumps back by 1 (returning to the start of the next day). For example, this is what happened on strictly conforming POSIX.1 systems at the end of 1998:

Unix time across midnight into 1 January 1999 (positive leap second)
TAI (1 January 1999) UTC (31 December 1998 to 1 January 1999) Unix time
1999-01-01T00:00:29.75 1998-12-31T23:59:58.75 915148798.75
1999-01-01T00:00:30.00 1998-12-31T23:59:59.00 915148799.00
1999-01-01T00:00:30.25 1998-12-31T23:59:59.25 915148799.25
1999-01-01T00:00:30.50 1998-12-31T23:59:59.50 915148799.50
1999-01-01T00:00:30.75 1998-12-31T23:59:59.75 915148799.75
1999-01-01T00:00:31.00 1998-12-31T23:59:60.00 915148800.00
1999-01-01T00:00:31.25 1998-12-31T23:59:60.25 915148800.25
1999-01-01T00:00:31.50 1998-12-31T23:59:60.50 915148800.50
1999-01-01T00:00:31.75 1998-12-31T23:59:60.75 915148800.75
1999-01-01T00:00:32.00 1999-01-01T00:00:00.00 915148800.00
1999-01-01T00:00:32.25 1999-01-01T00:00:00.25 915148800.25
1999-01-01T00:00:32.50 1999-01-01T00:00:00.50 915148800.50
1999-01-01T00:00:32.75 1999-01-01T00:00:00.75 915148800.75
1999-01-01T00:00:33.00 1999-01-01T00:00:01.00 915148801.00
1999-01-01T00:00:33.25 1999-01-01T00:00:01.25 915148801.25

Unix time numbers are repeated in the second immediately following a positive leap second. The Unix time number 1483142400 is thus ambiguous: it can refer either to start of the leap second (2016-12-31 23:59:60) or the end of it, one second later (2017-01-01 00:00:00). In the theoretical case when a negative leap second occurs, no ambiguity is caused, but instead there is a range of Unix time numbers that do not refer to any point in UTC time at all.

A Unix clock is often implemented with a different type of positive leap second handling associated with the Network Time Protocol (NTP). This yields a system that does not conform to the POSIX standard. See the section below concerning NTP for details.

When dealing with periods that do not encompass a UTC leap second, the difference between two Unix time numbers is equal to the duration in seconds of the period between the corresponding points in time. This is a common computational technique. However, where leap seconds occur, such calculations give the wrong answer. In applications where this level of accuracy is required, it is necessary to consult a table of leap seconds when dealing with Unix times, and it is often preferable to use a different time encoding that does not suffer from this problem.

A Unix time number is easily converted back into a UTC time by taking the quotient and modulus of the Unix time number, modulo 86400. The quotient is the number of days since the epoch, and the modulus is the number of seconds since midnight UTC on that day. If given a Unix time number that is ambiguous due to a positive leap second, this algorithm interprets it as the time just after midnight. It never generates a time that is during a leap second. If given a Unix time number that is invalid due to a negative leap second, it generates an equally invalid UTC time. If these conditions are significant, it is necessary to consult a table of leap seconds to detect them.

Non-synchronous Network Time Protocol-based variant

Commonly a Mills-style Unix clock is implemented with leap second handling not synchronous with the change of the Unix time number. The time number initially decreases where a leap should have occurred, and then it leaps to the correct time 1 second after the leap. This makes implementation easier, and is described by Mills' paper. This is what happens across a positive leap second:

Non-synchronous Mills-style Unix clock
across midnight into 1 January 1999 (positive leap second)
TAI (1 January 1999) UTC (31 December 1998 to 1 January 1999) State Unix clock
1999-01-01T00:00:29.75 1998-12-31T23:59:58.75 TIME_INS 915148798.75
1999-01-01T00:00:30.00 1998-12-31T23:59:59.00 TIME_INS 915148799.00
1999-01-01T00:00:30.25 1998-12-31T23:59:59.25 TIME_INS 915148799.25
1999-01-01T00:00:30.50 1998-12-31T23:59:59.50 TIME_INS 915148799.50
1999-01-01T00:00:30.75 1998-12-31T23:59:59.75 TIME_INS 915148799.75
1999-01-01T00:00:31.00 1998-12-31T23:59:60.00 TIME_INS 915148800.00
1999-01-01T00:00:31.25 1998-12-31T23:59:60.25 TIME_OOP 915148799.25
1999-01-01T00:00:31.50 1998-12-31T23:59:60.50 TIME_OOP 915148799.50
1999-01-01T00:00:31.75 1998-12-31T23:59:60.75 TIME_OOP 915148799.75
1999-01-01T00:00:32.00 1999-01-01T00:00:00.00 TIME_OOP 915148800.00
1999-01-01T00:00:32.25 1999-01-01T00:00:00.25 TIME_WAIT 915148800.25
1999-01-01T00:00:32.50 1999-01-01T00:00:00.50 TIME_WAIT 915148800.50
1999-01-01T00:00:32.75 1999-01-01T00:00:00.75 TIME_WAIT 915148800.75
1999-01-01T00:00:33.00 1999-01-01T00:00:01.00 TIME_WAIT 915148801.00
1999-01-01T00:00:33.25 1999-01-01T00:00:01.25 TIME_WAIT 915148801.25

This can be decoded properly by paying attention to the leap second state variable, which unambiguously indicates whether the leap has been performed yet. The state variable change is synchronous with the leap. 

A similar situation arises with a negative leap second, where the second that is skipped is slightly too late. Very briefly the system shows a nominally impossible time number, but this can be detected by the TIME_DEL state and corrected. 

In this type of system the Unix time number violates POSIX around both types of leap second. Collecting the leap second state variable along with the time number allows for unambiguous decoding, so the correct POSIX time number can be generated if desired, or the full UTC time can be stored in a more suitable format. 

The decoding logic required to cope with this style of Unix clock would also correctly decode a hypothetical POSIX-conforming clock using the same interface. This would be achieved by indicating the TIME_INS state during the entirety of an inserted leap second, then indicating TIME_WAIT during the entirety of the following second while repeating the seconds count. This requires synchronous leap second handling. This is probably the best way to express UTC time in Unix clock form, via a Unix interface, when the underlying clock is fundamentally untroubled by leap seconds.

TAI-based variant

Another, much rarer, non-conforming variant of Unix time keeping involves encoding TAI rather than UTC; some Linux systems are configured this way. 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:00 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 time stamps and local time. Conversion also runs into definitional problems prior to the 1972 commencement of the current form of UTC (see section UTC basis below).

This TAI-based 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 was proposed for inclusion in ISO C's time.h, but only the UTC part was accepted in 2011. A tai_clock does, however, exist in C++20.

Representing the number

A Unix time number can be represented in any form capable of representing numbers. In some applications the number is simply represented textually as a string of decimal digits, raising only trivial additional problems. However, certain binary representations of Unix times are particularly significant. 

The Unix time_t data type that represents a point in time is, on many platforms, a signed integer, traditionally of 32 bits (but see below), directly encoding the Unix time number as described in the preceding section. Being 32 bits means that it covers a range of about 136 years in total. The minimum representable date is Friday 1901-12-13, and the maximum representable date is Tuesday 2038-01-19. One second after 03:14:07 UTC 2038-01-19 this representation will overflow. This milestone is anticipated with a mixture of amusement and dread—see year 2038 problem

In some newer operating systems, time_t has been widened to 64 bits. This expands the times representable by approximately 293 billion years in both directions, which is over twenty times the present age of the universe per direction. 

There was originally some controversy over whether the Unix time_t should be signed or unsigned. If unsigned, its range in the future would be doubled, postponing the 32-bit overflow (by 68 years). However, it would then be incapable of representing times prior to the epoch. The consensus is for time_t to be signed, and this is the usual practice. The software development platform for version 6 of the QNX operating system has an unsigned 32-bit time_t, though older releases used a signed type. 

The POSIX and Open Group Unix specifications include the C standard library, which includes the time types and functions defined in the header file. The ISO C standard states that time_t must be an arithmetic type, but does not mandate any specific type or encoding for it. POSIX requires time_t to be an integer type, but does not mandate that it be signed or unsigned. 

Unix has no tradition of directly representing non-integer Unix time numbers as binary fractions. Instead, times with sub-second precision are represented using composite data types that consist of two integers, the first being a time_t (the integral part of the Unix time), and the second being the fractional part of the time number in millionths (in struct timeval) or billionths (in struct timespec). These structures provide a decimal-based fixed-point data format, which is useful for some applications, and trivial to convert for others.

UTC basis

The present form of UTC, with leap seconds, is defined only starting from 1 January 1972. Prior to that, since 1 January 1961 there was an older form of UTC in which not only were there occasional time steps, which were by non-integer numbers of seconds, but also the UTC second was slightly longer than the SI second, and periodically changed to continuously approximate the Earth's rotation. Prior to 1961 there was no UTC, and prior to 1958 there was no widespread atomic timekeeping; in these eras, some approximation of GMT (based directly on the Earth's rotation) was used instead of an atomic timescale.

The precise definition of Unix time as an encoding of UTC is only uncontroversial when applied to the present form of UTC. The Unix epoch predating the start of this form of UTC does not affect its use in this era: the number of days from 1 January 1970 (the Unix epoch) to 1 January 1972 (the start of UTC) is not in question, and the number of days is all that is significant to Unix time. 

The meaning of Unix time values below +63072000 (i.e., prior to 1 January 1972) is not precisely defined. The basis of such Unix times is best understood to be an unspecified approximation of UTC. Computers of that era rarely had clocks set sufficiently accurately to provide meaningful sub-second timestamps in any case. Unix time is not a suitable way to represent times prior to 1972 in applications requiring sub-second precision; such applications must, at least, define which form of UT or GMT they use. 

As of 2009, the possibility of ending the use of leap seconds in civil time is being considered. A likely means to execute this change is to define a new time scale, called International Time, that initially matches UTC but thereafter has no leap seconds, thus remaining at a constant offset from TAI. If this happens, it is likely that Unix time will be prospectively defined in terms of this new time scale, instead of UTC. Uncertainty about whether this will occur makes prospective Unix time no less predictable than it already is: if UTC were simply to have no further leap seconds the result would be the same.

History

The earliest versions of Unix time had a 32-bit integer incrementing at a rate of 60 Hz, which was the rate of the system clock on the hardware of the early Unix systems. The value 60 Hz still appears in some software interfaces as a result. The epoch also differed from the current value. The first edition Unix Programmer's Manual dated 3 November 1971 defines the Unix time as "the time since 00:00:00, 1 January 1971, measured in sixtieths of a second".

The User Manual also commented that "the chronologically-minded user will note that 2**32 sixtieths of a second is only about 2.5 years". Because of this limited range, the epoch was redefined more than once, before the rate was changed to 1 Hz and the epoch was set to its present value of 1 January 1970 00:00:00 UTC. This yielded a range of about 136 years, half of it before 1970 and half of it afterwards. 

As indicated by the definition quoted above, the Unix time scale was originally intended to be a simple linear representation of time elapsed since an epoch. However, there was no consideration of the details of time scales, and it was implicitly assumed that there was a simple linear time scale already available and agreed upon. The first edition manual's definition does not even specify which time zone is used. Several later problems, including the complexity of the present definition, result from Unix time having been defined gradually by usage rather than fully defined from the outset.




When POSIX.1 was written, the question arose of how to precisely define time_t in the face of leap seconds. The POSIX committee considered whether Unix time should remain, as intended, a linear count of seconds since the epoch, at the expense of complexity in conversions with civil time or a representation of civil time, at the expense of inconsistency around leap seconds. Computer clocks of the era were not sufficiently precisely set to form a precedent one way or the other. 


The POSIX committee was swayed by arguments against complexity in the library functions, and firmly defined the Unix time in a simple manner in terms of the elements of UTC time. This definition was so simple that it did not even encompass the entire leap year rule of the Gregorian calendar, and would make 2100 a leap year.




The 2001 edition of POSIX.1 rectified the faulty leap year rule in the definition of Unix time, but retained the essential definition of Unix time as an encoding of UTC rather than a linear time scale. Since the mid-1990s, computer clocks have been routinely set with sufficient precision for this to matter, and they have most commonly been set using the UTC-based definition of Unix time. This has resulted in considerable complexity in Unix implementations, and in the Network Time Protocol, to execute steps in the Unix time number whenever leap seconds occur.

Notable events in Unix time

Unix enthusiasts have a history of holding "time_t parties" (pronounced "time tea parties") to celebrate significant values of the Unix time number. These are directly analogous to the new year celebrations that occur at the change of year in many calendars. As the use of Unix time has spread, so has the practice of celebrating its milestones. Usually it is time values that are round numbers in decimal that are celebrated, following the Unix convention of viewing time_t values in decimal. Among some groups round binary numbers are also celebrated, such as +230 which occurred at 13:37:04 UTC on Saturday, 10 January 2004.

The events that these celebrate are typically described as "N seconds since the Unix epoch", but this is inaccurate; as discussed above, due to the handling of leap seconds in Unix time the number of seconds elapsed since the Unix epoch is slightly greater than the Unix time number for times later than the epoch.
  • At 18:36:57 UTC on Wednesday, 17 October 1973, the first appearance of the date in ISO 8601 format[a] (1973-10-17) within the digits of Unix time (119731017) took place.
  • At 01:46:40 UTC on Sunday, 9 September 2001, the Unix billennium (Unix time number 1000000000) was celebrated. The name billennium is a portmanteau of billion and millennium. Some programs which stored timestamps using a text representation encountered sorting errors, as in a text sort times after the turnover, starting with a 1 digit, erroneously sorted before earlier times starting with a 9 digit. Affected programs included the popular Usenet reader KNode and e-mail client KMail, part of the KDE desktop environment. Such bugs were generally cosmetic in nature and quickly fixed once problems became apparent. The problem also affected many Filtrix document-format filters provided with Linux versions of WordPerfect; a patch was created by the user community to solve this problem, since Corel no longer sold or supported that version of the program.
  • At 23:31:30 UTC on Friday, 13 February 2009, the decimal representation of Unix time reached 1234567890 seconds. Google celebrated this with a Google doodle. Parties and other celebrations were held around the world, among various technical subcultures, to celebrate the 1234567890th second.
  • At 03:33:20 UTC on Wednesday, 18 May 2033, the Unix time value will equal 2000000000 seconds.
  • At 06:28:16 UTC on Thursday, 7 February 2036, Network Time Protocol will loop over to the next epoch, as the 32-bit time stamp value used in NTP (unsigned, but based on 1 January 1900) will overflow. This date is close to the following date because the 136-year range of a 32-bit integer number of seconds is close to twice the 70-year offset between the two epochs.
  • At 03:14:08 UTC on Tuesday, 19 January 2038, 32-bit versions of the Unix time stamp will cease to work, as it will overflow the largest value that can be held in a signed 32-bit number (7FFFFFFF16 or 2147483647). Before this moment, software using 32-bit time stamps will need to adopt a new convention for time stamps, and file formats using 32-bit time stamps will need to be changed to support larger time stamps or a different epoch. If unchanged, the next second will be incorrectly interpreted as 20:45:52 Friday 13 December 1901 UTC. This is referred to as the Year 2038 problem.
  • At 05:20:00 UTC on Saturday, 24 January 2065, the Unix time value will equal 3000000000 seconds.
  • At 06:28:15 UTC on Sunday, 7 February 2106, the Unix time will reach FFFFFFFF16 or 4294967295 seconds which, for systems that hold the time on 32-bit unsigned integers, is the maximum attainable. For some of these systems, the next second will be incorrectly interpreted as 00:00:00 Thursday 1 January 1970 UTC. Other systems may experience an overflow error with unpredictable outcomes.
  • At 15:30:08 UTC on Sunday, 4 December 292277026596, 64-bit versions of the Unix time stamp cease to work, as it will overflow the largest value that can be held in a signed 64-bit number. This is nearly 22 times the estimated current age of the universe, which is 1.37×1010 years (13.7 billion).

In literature and calendrics

Vernor Vinge's novel A Deepness in the Sky describes a spacefaring trading civilization thousands of years in the future that still uses the Unix epoch. The "programmer-archaeologist" responsible for finding and maintaining usable code in mature computer systems first believes that the epoch refers to the time when man first walked on the Moon, but then realizes that it is "the 0-second of one of Humankind's first computer operating systems".

Inhalant

From Wikipedia, the free encyclopedia https://en.wikipedia.org/w...