你的新技术仍然停留在 1970 年——原因如下
Your new tech is still stuck in the year 1970 — here's why
不用担心;你的电脑并没有回到过去。
您很有可能在计算机或其他设备上看到过 1970 年 1 月 1 日这一日期,即使您当时已经不在人世。您可能会假设这代表计算中的重要日期,或者它是机器无法读取时间的随机占位符日期。实际上,虽然日期本身并不特殊,但它代表了计算机计时的重要组成部分。
就像计算中的一切一样,得出这个日期的方法是有限的,这意味着我们将来会遇到问题。这一切都与关于计算机(和人类)如何跟踪时间的更有趣的讨论有关,这比您想象的要复杂。
UTC 1970 年 1 月 1 日 00:00(午夜)是 Unix 时间的纪元。纪元是指一个特定的、有影响力的时刻,通常对应于计时系统的启动。 Unix 是我们认为最早的现代操作系统之一,于 20 世纪 60 年代末开始开发。它是许多其他被称为“类 Unix”操作系统的基础,包括 Linux、macOS 和 Android。 Windows 是主要的异常值。
当 Unix 处于开发阶段时,其开发人员需要一种方法来记录时间。一些早期尝试使用了 60Hz 的系统时钟速度,但将其存储在 32 位整数中会导致该值在不到 2.5 年后就会耗尽空间。一段时间后,他们将计时方式更改为使用秒,并选择 1970 年 1 月 1 日作为“圆形”任意日期开始,认为时间的 32 位整数不会很快耗尽空间(稍后会详细介绍)。
直到今天,Unix 时间仍然通过跟踪自 1970 年 1 月 1 日午夜(UTC)以来经过的秒数来记录。 UTC(协调世界时)是一个显而易见的选择,因为它已经成为跨时区跟踪时间的标准。对于计算机来说,比较两个数字并计算它们之间的差异很简单,而不必担心我们在时间上的所有规则。系统将时间戳(包括您的时区与 UTC 的偏移量)转换为我们人类可读的格式。
您可能会在电子表格、应用程序、文件元数据、错误屏幕和其他各种位置中看到 1970-01-01 日期。除非这个日期恰好与某人的生日或其他重大事件一致,否则通常是错误的结果。当类 Unix 系统尝试检查时间并遇到问题或收到 0 值时,它将默认为纪元。如果您居住的时区落后于 UTC,您可能会在 1969 年 12 月 31 日当天晚些时候看到这些默认值。
传统的 Unix 时间保存为有符号 32 位整数,即 32 位二进制值,每个数字可以是 1 或 0。有符号整数可以跟踪正数和负数,而无符号整数只能是正数。在跟踪时间的情况下,需要使用有符号值来跟踪 1970 年之前的日期。因为有符号整数的第一个(最左边)位用于指示它是否为负数,所以与无符号数相比,它会将可能值的范围减半。
无符号整数的最大值为 2^31,即 4,294,967,295。有符号值可以代表每个方向的一半,最高为 2,147,483,647,最低为 -2,147,483,648。因此,Unix 时间有一个“截止日期”。一旦超过秒上限,最左边的数字将变为 1,这会导致数字的其余部分被解释为负数。这将发生在 UTC 时间 2038 年 1 月 19 日凌晨 3:14:07,这就是为什么您会听到这被称为“2038 年问题”。一旦整数溢出,时间将错误地显示 UTC 时间 1901 年 12 月 13 日晚上 8:45:52,并从那里继续计数。
值得庆幸的是,在此日期之前我们已经(并且仍然有)充足的时间来实施解决方法。大多数现代类 Unix 系统现在使用 64 位整数来记录时间,它可以在溢出之前记录大约 2920 亿年的秒数——如果到那时还有人在,将时间移至 128 位整数将是他们的问题。现代 MacBook 是 64 位的,可以正常工作,而 iPhone 4 这样的 32 位设备就会遇到麻烦。
2038 年到来时的主要风险在于无法轻松更新的旧系统,例如嵌入电器、车辆、相机等中的系统。其中一些即使无法保持准确的时间也不会受到严重影响,但如果时间是一个关键因素,我们将不得不更换 12 年后仍然存在的所有设备。
您可能想知道这次问题是否与 Y2K 有关(也有一个类似的名称,“2000 年问题”),这是进入新千年的一大担忧。虽然两者都是围绕计算机保持时间而展开的,但过去的问题是由十进制速记引起的,而不是二进制溢出。
在计算的早期,内存非常昂贵,因此程序员尽可能节省内存。因此,假设前两位数字始终为“19”,则通常使用两位数字来表示年份。 Y2K 是担心一旦进入 2000 年,计算机会将“00”解释为 1900 年(或其他更早的日期)而不是 2000 年,从而给依赖精确时间的程序带来各种问题。当时这是一个很大的恐慌,但最终并没有像预期的那么可怕(这取决于你问的是谁,要么是由于预防工作,要么是因为这个问题一开始就不是那么严重)。
Unix 时间并不是计算机处理时钟的唯一方式。许多机器都有一个实时时钟,它可以像挂钟一样记录时间,并在计算机关闭时使用 CMOS 电池保持电量。当电池耗尽时,您计算机的时钟将不再准确。
正如前面提到的例外,Windows 会跟踪从 1601 年 1 月 1 日午夜 UTC 开始的 100 纳秒刻度的时间差异。虽然它比 1970 年要早得多,但这个时代并不是随机的;它是一个随机的时代。公历我们...
原文(English)
Don’t worry; your computer isn’t being transported back to the past.
There's a good chance you've seen the date January 1, 1970 on a computer or other device, even if you weren't alive back then. You might assume this represents a significant date in computing, or that it's a random placeholder date for when a machine fails to read the time. In actuality, while the date is not special in itself, it represents an important part of how computers keep time.
Like everything in computing, the method that leads to this date is finite, meaning we'll have problems with it in the future. This all ties into a more interesting discussion of how computers (and humans) keep track of time, which is more complicated than you might think.
January 1, 1970 at 00:00 (midnight) UTC is the epoch of Unix time. An epoch refers to a specific, impactful moment, usually corresponding to the start of a timekeeping system. Unix was one of the first operating systems we would consider modern, beginning development in the late 1960s. It's the basis for many other operating systems that are known as "Unix-like," including Linux, macOS and Android. Windows is the main outlier.
When Unix was in development, its developers needed a way to keep track of time. A few early attempts used the system clock speed of 60Hz, but storing this in a 32-bit integer resulted in a value that would run out of room after less than 2.5 years. After some time, they changed the time-keeping to use seconds and chose January 1, 1970 as a "round" arbitrary date to begin at, figuring that the 32-bit integer for time wouldn't run out of space anytime soon (more on that later).
To this day, Unix time is kept by tracking the number of seconds that have passed since Jan 1, 1970 at midnight UTC. UTC (Coordinated Universal Time) was an obvious choice since it's already the standard for keeping track of time across time zones. It's simple for a computer to compare two numbers and calculate the difference between them without worrying about all the rules we have around time. The system converts the timestamp, including your time zone's offset from UTC, into our human-readable format.
You might see the 1970-01-01 date appear in spreadsheets, apps, file metadata, error screens and various other places. Unless this date happens to line up with someone's birthday or another major event, it's usually the result of an error. When a Unix-like system tries to check the time and runs into a problem or receives a 0 value, it will default to the epoch. If you live in a time zone that's behind UTC, you'll likely see these default values as late in the day on December 31, 1969 instead.
Traditional Unix time is kept as a signed 32-bit integer, a binary value with 32 digits that can each be 1 or 0. Signed integers can track positive and negative numbers, while unsigned integers can only be positive. In the case of tracking time, using a signed value is necessary to track dates before 1970. Because the first (leftmost) bit of a signed integer is used to indicate whether it's negative, it cuts the range of possible values in half compared to an unsigned number.
An unsigned integer's maximum value is 2^31, or 4,294,967,295. A signed value can represent half of this in each direction, going as high as 2,147,483,647 and as low as -2,147,483,648. Unix time thus has an "expiration date." Once that upper limit of seconds has passed, the leftmost digit will become a 1, which causes the rest of the number to be interpreted as negative. This will happen on January 19, 2038 at 3:14:07 AM UTC, which is why you'll hear this called the "year 2038 problem." Once the integer overflows, the time will incorrectly show December 13, 1901 at 8:45:52 PM UTC and continue counting up from there.
Thankfully, we've had (and still have) plenty of time to implement workarounds before this date. Most modern Unix-like systems now use a 64-bit integer to keep track of time, which can keep track of seconds for some 292 billion years before overflowing — if anyone is still around by then, moving time to a 128-bit integer will be their problem. Your modern MacBook is 64-bit and will work fine, while a 32-bit device like an iPhone 4 will run into trouble.
The main risk for when 2038 rolls around is in old systems that can't easily be updated, like those embedded in appliances, vehicles, cameras and similar. Some of those won't be heavily affected even if they can't keep the exact time, but we'll have to replace any of those devices still around in 12 years if time is a critical factor.
You might wonder if this time problem is related to Y2K (which also had a similar name, "year 2000 problem"), which was a big worry going into the new millennium. While both revolve around computers keeping time, the past problem was caused by decimal shorthand, not binary overflow.
In the early days of computing, memory was extremely expensive, so programmers saved wherever possible. It was thus common to use two digits to indicate the year, assuming that the first two digits were always "19". Y2K was the worry that once the year hit 2000, computers would interpret "00" as 1900 (or another earlier date) instead of 2000, causing all kinds of problems for programs that relied on accurate time. It was a big scare at the time, but ended up not being nearly as terrible as expected (which, depending on who you ask, was either due to prevention efforts or because the issue was never huge to begin with).
Unix time is not the only way that computers handle the clock. Many machines have a real-time clock, which keeps track of the time similarly to a wall clock and retains power using the CMOS battery when the computer is powered off. When this battery dies, your computer's clock won't be right.
Windows, as the exception mentioned earlier, keeps track of time differences in 100-nanosecond ticks starting January 1, 1601 at midnight UTC. While it's much older than 1970, this epoch isn't random; the Gregorian calendar we…
本文为自动翻译,可能存在偏差,请以原文为准。发布于 2026-11-15 00:45
阅读原文 ↗https://www.engadget.com/2311725/new-tech-stick-in-year-1970