### 為什么1/1/1970是“紀元時間”?

#### [英]Why is 1/1/1970 the “epoch time”?

Why is

1 January 1970 00:00:00

1970年1月1日就是

considered the epoch time?

## 4 个解决方案

### #1

370

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.

unix的早期版本以1/60秒的間隔測量系統時間。這意味着一個32位無符號整數只能表示小於829天的時間跨度。由於這個原因，以數字0(稱為紀元)表示的時間必須在最近的過去被設定。就像上世紀70年代初那樣，時代被設定為1971-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.

### #2

43

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".

Unix最早的版本是32位整數，以60赫茲的速率遞增，這是早期Unix系統硬件上系統時鍾的速率。因此，值60 Hz仍然出現在一些軟件界面中。時代也不同於當前的價值。1971年11月3日的第一版Unix程序員手冊將Unix時間定義為“1971年1月1日00:00時以來的時間，以0 / 6秒為單位”。

### #3

7

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.

http://en.wikipedia.org/wiki/Unix_time#歷史解釋了一些關於Unix時間的起源和所選擇的紀元。unix時間和歷元日期的定義在穩定之前經歷了一些變化。

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

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".

1971年11月3日的第一版Unix程序員手冊將Unix時間定義為“1971年1月1日00:00時以來的時間，以0 / 6秒為單位”。

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.

### #4

-7

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.