Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When was Unix epoch time revised from 1971 to current 1970 value?

According to the first edition Unix Programmer's Manual, Unix time is defined as "the time since 00:00:00, January 1, 1971, measured in sixtieths of a second"

When did this change to its current value of midnight (UTC), January 1, 1970?

like image 557
Andrew Avatar asked Jul 20 '12 04:07

Andrew


People also ask

Why is the epoch January 1 1970?

January 1st, 1970 at 00:00:00 UTC is referred to as the Unix epoch. Early Unix engineers picked that date arbitrarily because they needed to set a uniform date for the start of time, and New Year's Day, 1970, seemed most convenient.

What is the current epoch time?

The Unix epoch is 00:00:00 UTC on 1 January 1970.

Why do computers count from 1970?

Computers don't count days, months or years, etc. Instead, they work on the number of seconds elapsed since midnight proleptic Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds. Why that date? Because it was convenient for early Unix engineers to work with.

Is epoch time always increasing?

If by timestamp you mean epoch, then yes. Number of seconds since a given date/time would only increase.


1 Answers

In First Edition Unix (November 1971), the manual page for the time system call stated that it returned "the time since 00:00:00, Jan. 1, 1971, measured in sixtieths of a second". This was a 32-bit value, so even treated as unsigned it could only track about 2.26 years beyond this date. However the manual page and source code comments describe the system call as "get time of year", the year could not be set, and the date command and ctime() function (used to format the date and time) did not format a year or even work correctly with time values larger than 1 year, so it was probably expected that the date would be manually reset each year and the year 1971 in the manual page was of little significance. Well, except for the little problem that 1972 has an extra day; regarding that, a note was later added to the bugs section: "The routine must be reassembled for leap year". Nice.

In 1972 the manual page for the time system call was changed to state that it returned the time since "00:00:00, Jan. 1, 1972", with the note: "The time is stored in 32 bits. This guarantees a crisis every 2.26 years."

In Fourth Edition Unix (November 1973) the time system call was changed to return "the time since 00:00:00 GMT, Jan. 1, 1970, measured in seconds". (The manual page is dated August 5, 1973, so that may have been when the changes were originally made.) This is essentially the current definition, except that the historic term GMT has been replaced by the more precise Coordinated Universal Time and clarifications have been made regarding leap seconds. On systems that return this as a signed 32-bit number, this will work until the year 2038. Fortunately many systems now use 64 bits for this value.

like image 62
mark4o Avatar answered Oct 08 '22 11:10

mark4o