views:

635

answers:

5
+14  Q: 

Epoch time

Why is

1 January 1970 00:00:00

considered the epoch time?

+5  A: 

Short answer: Why not?

Longer answer: The time itself doesn't really matter, as long as everyone who uses it agrees on its value. As 1/1/70 has been in use for so long, using it will make you code as understandable as possible for as many people as possible.

There's no great merit in choosing an arbitrary epoch just to be different.

Visage
But why 1970 is chosen as the year.
rahul
Because Unix was developed in 1969 and first released in 1971 and it was thus reasonable to assume that no machine would have to represent a system time earlier than 1970-01-01-00:00:00.
Jörg W Mittag
+2  A: 

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 November 3, 1971 defines the Unix time as "the time since 00:00:00, Jan. 1, 1971, measured in sixtieths of a second".

Stu Thompson
Epoch time is 1 January 1970, not 1 January 1971.
Steve Harrison
@Steve: Historically, he's right, you're wrong. ;-)
Stobor
+2  A: 

http://en.wikipedia.org/wiki/Unix_time#History explains a little about the origins of Unix time and the chosen epoch. The definition of unix time and the epoch date went through a couple of changes before stabilizing on what it is now.

But it does not say why exactly 1/1/1970 was chosen in the end.

Notable excerpts from the Wikipedia page:

The first edition Unix Programmer's Manual dated November 3, 1971 defines the Unix time as "the time since 00:00:00, Jan. 1, 1971, measured in sixtieths of a second".

Because of [the] 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.

Several later problems, including the complexity of the present definition, result from Unix time having been defined gradually by usage rather than fully defined to start with.

Dawie Strauss
+23  A: 

Early versions of unix measured system time in 1/60 s intervals. This meant that a 32-bit unsigned integer could only represent a span of time less than 829 days. For this reason, the time represented by the number 0 (called the epoch) had to be set in the very recent past. As this was in the early 1970s, the epoch was set to 1971-1-1.

Later, the system time was changed to increment every second, which increased the span of time that could be represented by a 32-bit unsigned integer to around 136 years. As it was no longer so important to squeeze every second out of the counter, the epoch was rounded down to the nearest decade, thus becoming 1970-1-1. One must assume that this was considered a bit neater than 1971-1-1.

Note that a 32-bit signed integer using 1970-1-1 as its epoch can represent dates up to 2038-1-19, on which date it will wrap around to 1901-12-13.

Matt Howells
Does 1/60 have anything to do with the frequency of the American power net?
xtofl
It's the frequency of one of the oscillators on the system boards used at the time. It wasn't necessary for the oscillator to be 60Hz since it ran on DC, but it was probably cheap to use whatever was most common at the time, and TVs were being mass-produced then...
Matt Howells
+4  A: 

The universe was created on Jan 1, 1970. Anyone who tells you otherwise is clearly lying.

ijw