昭和百年难题
The Showa Hundred Year Problem

原始链接: https://www.dampfkraft.com/showa-100.html

## 2025年的“非事件”:日本“昭和百年问题” 2025年是包括黑松沙士和丘比沙拉酱等日本标志性食品,以及巨型三浦大根在内,诸多事物诞生一百周年。然而,它也悄然度过了令人担忧的“昭和百年问题”,这是一种源于日本皇纪年代系统的、类似Y2K的潜在故障。 日本同时使用公历和皇纪,2025年是“令和7年”。虽然看似象征性,但皇纪年份对于法律、金融和医疗记录至关重要。漫长的昭和时代(1926-1989年)持续了62年,正值计算机时代黎明,引发了担忧。程序员可能只存储昭和年份的后两位数字,可能导致从‘99’到‘00’的“回滚”,并将事件错误地记录到1925年。 尽管预测会出现金融和互联网混乱,但什么也没发生。大多数易受攻击的系统已经更新或退役。皇纪系统的一个特点——历代从第一年开始,而不是从零年开始——也意味着真正的百年纪念实际上是在2026年,可能会将问题推迟到未来。最终,“问题”被证明是一个“非事件”,与1999年广泛的Y2K焦虑形成了鲜明对比。

## 昭和百年问题:一场虚惊? 一则Hacker News上的讨论围绕着“昭和百年问题”,这是日本在过渡到令和时代(2019/2025)时预计出现的一个日期变更问题。虽然文章预测可能出现中断,尤其是在2025年临近时,但实际问题的报告却很少。 普遍的看法是,这归因于开发者普遍回避皇历系统,以及严重依赖它的组织——例如政府在印刷材料方面——通常使用静态数据或在内部转换为标准日期(如Unix时间)。然而,一些用户指出皇历仍然用于重要的文件,如银行对账单和税务表格。 有趣的是,Windows计算器过去出现的问题凸显了时代转换的复杂性,表明即使是更新后的系统在考虑区域日历偏好时,也可能难以进行日期计算。对话还涉及了旧硬件中类似的日期相关错误,以及即将到来的Unix时间的2038问题。最终,“问题”似乎已被 largely 避免,类似于相对平稳的Y2K过渡。
相关文章

原文

There are many notable hundredth anniversaries in 2025. This year marks the origin of Hey Song, Taiwan's singular sarsaparilla; Kewpie Mayonnaise, known for its tang and naked dolls; Bontan Ame, a railway kiosk staple with gentle pomelo flavor; and even the naming of the Miura Daikon, which is much too big to be called a mere vegetable. But one particular event turned out to be happily unremarkable. 2025 was the hundreth year of the Showa imperial era, and, thankfully, at one minute past midnight on January 1, 2025, nothing happened.

Some things celebrating their hundredth anniversary in 2025.

The Showa era actually ended in 1989 with the emperor's death and was no longer used for dates, but the unusual length of the period and its overlap with the rise of personal computing meant that the hundredth anniversary was long feared as a peculiarly Japanese version of the Y2K problem. In practice the date change appears to have passed without issue, but before the number goes up one more let's take a look about what all the fuss was about.

First, a quick refresh on the Japanese imperial year system. Briefly, besides the Gregorian calendar year, every year belongs to an imperial era. So 2025 is also the 7th year of the Reiwa Era, typically simply referred to as Reiwa 7. While daily life in Japan usually uses Gregorian calendar years, imperial eras are not merely symbolic, and imperial year numbering is widely used in laws, taxes, finance, religion, and medical records, to give just a few examples.

Until the Meiji era becan in 1868, imperial eras changed mostly arbitrarily and frequently, with average length around five years, with the shortest era lasting less than three months. Following the introduction of constitutional government the imperial era was tied to the reigning emperor, and simply begins as he takes the throne and ends when he dies or (in the most recent case) retires. Additionally, years increment with Gregorian calendar years, so they don't all last 365 days. (This also means that, when an era changes, the Gregorian year will have two imperial year designations, for example 1989 is both Showa 64 and Heisei 1, depending whether the day of the year is before or after the imperial transition.) In the modern period Japan has had five eras - Meiji, Taisho, Showa, Heisei, and the current Reiwa.

The Showa period is a bit exceptional from a calendar perspective, particularly as it relates to computers. The Taisho period was brief, just around fifteen years, meaning the Showa emperor took the throne at a young age and had a long reign. In total the period lasted 62 years, making it the longest era by an almost twenty year margin. (If you noticed a contradiction, don't worry, we'll get to it.) This long period also had another feature that's of interest: since it lasted from 1926 to 1989, it happened to cover the entire early history of computing.

Given all the above, you may have already figured out what the Showa Hundred Year Problem is - it's essentially the same problem as Y2K, just shifted to the start of the Showa era rather than the 20th century. Suppose that somewhere a programmer had to display dates according to Japanese imperial years. Suppose that, since their entire career (and probably entire life) the only era in use had been Showa, they used the Showa year to store the date in the program. And since they weren't thinking about thirty years in the future, they only stored it as two digits.

It's unlikely this program would be around over thirty years later. But perhaps part of the program survived into the Heisei era, and someone just wrote a little patch that checked if the number was greater than 63, and subtracted that to show the Heisei year - a formatting trick to avoid rewriting old but functional code. But if that happened, then actually the internal representation of the year could still be just a two digit decimal number.

So what happens when the year wraps around from 99 to 00? Things that should happen in 2025 instead somehow belong to 1925, cats and dogs live together, and hell breaks loose, or something like that. Mu, Japan's monthly magazine of the strange, featured an article about the problem on the cover of its November 2024 special issue, issue describing the potential downfall of the financial system and the Internet, though the piece only rated a small mention on the cover. The article was light on technical details, and also curiously described Unix as a programming language.

While a number of articles cropped up explaining what the Showa Hundred Year Problem was leading up to 2025, they passed mostly unnoticed, mere curiosities compared to the major media attention showered on Y2K a quarter century ago. And, in fact, as 2025 comes to a close, I can't find any reports of actual issues stemming from the date change. There are a few records of preparations for any issues, but even those are from the past, and it seems that any system old enough to be a source of problems had already outlived its natural usefulness.

That said, while reviewing documents about the problem there is one little detail that struck me. Centuries in the Gregorian calendar start from 00 with their last two digits - 1800, 1900, and 2000. But that isn't the case for imperial eras, which don't have a zero year, and start from year one. That means that for anything started in the first year of an imperial era, like Cafe Lion, the hundredth anniversary is not year 100, but year 101. (This is also why the last Showa year was 64 even though the era only lasted 62 full years - it started on December 25, 1926, and ended just a week into 1989.)

What if a system somewhere stored the first year as zero, and just added one for output and formatting? If there is a system like that, it wouldn't run into overflow issues in Showa 100, but in Showa 101... or 2026.

But I'm sure it'll be fine. Ψ

联系我们 contact @ memedata.com