
'Japan's millennium bug' ahead of Akihito's abdication - Manu1987
https://www.theguardian.com/technology/2018/jul/25/big-tech-warns-japan-millennium-bug-y2k-emperor-akihito-abdication
======
yoz-y
How pervasive is the Japanese calendar in computing actually? I suppose most
programs calculate all dates internally using UNIX timestamps or UTC and only
convert that to Japanese dates for display purposes. Anybody has any
experience with this?

~~~
jerf
I don't think that's the problem; I think that's the one thing that's not a
problem. Monotonic time is not that hard. The hardest thing about it is just
convincing programmers to use it, and making sure your libraries use it
properly. I don't want to say it's trivial, but it's not that hard once both
you and your code base internalize "convert everything to internal UTC
representation as quickly as possible, convert to local time as late as
possible on the way out".

It's everything else that's a problem. It's the places where you input the
Japanese time, and there's an era that the code has never heard of for some
old system. There is no way for that system to even conceivably handle it
without some sort of update, at least a database update. They're talking about
creating a new character for the era, which literally no system on Earth can
currently use because it doesn't even exist yet, and, again, anything old that
can't be updated can't conceivably display it correctly. They might be able to
display it as the individual characters, but they still won't know that's a
date, or that they have to. As mipmap04 says, it's where Japanese dates were
stored as a string or something, because goodness knows I've seen enough US
dates stored as strings.

And inferring from the article that the tax authority is going to extend the
old era, I assume that at the very least a good chunk of the government works
on Japanese dates, so it's going to be important not to, say, print tax forms
that have � in the date, etc.

~~~
athenot
UTC is good but not enough; it may still bite you in the behind.

What's the time difference between these 2 timestamps:

    
    
        2016-12-31 23:59:50 UTC    (unix time 1483232390)
        2017-01-01 00:00:10 UTC    (unix time 1483232410)
    

That's right: 21 seconds, due to the added leap second 23:59:60.

So then your next option is to use TAI (international atomic time). Of course
for most applications, this extra/missing leap second doesn't matter.

And that's the crux of the issue. Given a level of abstraction, we're
comfortable with a _sufficient_ level of accuracy because it's the most
convenient for 99% of the use cases. It takes a widely adopted tooling to bump
the abstraction to a more accurate representation. In UNIX land, going from
YYYYMMDDHHMMSS to a number of seconds has been a huge improvement. It's
comfortable to use because all environments have the tooling to go back and
forth from seconds to human-readable dates.

Try to use TAI and you start feeling a lot more lonely (ever tried to read
logs timestamped in TAI? fun!) Most OS and server processes are used with the
tradeoff that it's not a big deal if we have 2 events spaced a second apart
and both timestamped the same (1483232399), since it's not that frequent.

~~~
bertil
Wait: are you saying that Unix time does not take into account the leap
second?!

~~~
chowells
Correct. POSIX time is defined as number of seconds per (non-leapsecond) day
times number of complete day since the epoch, plus the number of seconds in
the current day.

POSIX timestamps get weird around leap seconds. Time stamps get repeated,
subtraction returns incorrect results, and so on.

~~~
mike_hearn
If you use Java and the java.time API they added in the last release, you're
covered for all of this.

[https://docs.oracle.com/javase/8/docs/api/java/time/Instant....](https://docs.oracle.com/javase/8/docs/api/java/time/Instant.html)

 _In this segment, the Java Time-Scale is identical to UTC-SLS. This is
identical to UTC on days that do not have a leap second. On days that do have
a leap second, the leap second is spread equally over the last 1000 seconds of
the day, maintaining the appearance of exactly 86400 seconds per day._

Java apps don't use UNIX time, they use something very similar called the Java
timeline which is basically the same as UTC but leap seconds are smeared.

The java.time API is really incredibly thorough. It does of course have
support for Japanese dates:

[https://docs.oracle.com/javase/8/docs/api/java/time/chrono/J...](https://docs.oracle.com/javase/8/docs/api/java/time/chrono/JapaneseDate.html)

The type system and runtime checks also catch subtle errors like assuming "one
day from now" and "in 24 hours from now" are the same thing.

------
hfdgiutdryg
It's seems silly to compare it to the y2k problem, aside from the bit at the
end of the article:

 _Many older computers, with aspects dating back to before the end of the
Shōwa era in 1989, have never been updated to reflect the new era, and still
think the year is Shōwa 93. That means Japan could face another mini Y2K
problem in 2025, as those systems attempt to tick over to a three digit Shōwa
year they can’t cope with._

The real problem with y2k was the amount of compiled code depending on two-
digit years. All those conditionals looked exactly like any other integer
comparison.

~~~
darkerside
It's much like Y2K if you think of the emperor as a digit in a unique
numbering system (empero-decimal?)

------
larkeith
See also this discussion from 23 days ago:
[https://news.ycombinator.com/item?id=17430085](https://news.ycombinator.com/item?id=17430085)

------
wodenokoto
Why can't the Unicode consortium not reserve codepoints for the next 10-50
eras and simply wait with filling in how it should look and what to be called?

~~~
moviuro
As jerf pointed out [0], you can do that but once you print that unknown
symbol, the Unicode consortium can't really do much.

Also, you can't just say "well, next era begins on September 1st 2054, so
let's write that in our date calculator" \- precisely because you don't know
when an era begins or ends before it's close.

[0]
[https://news.ycombinator.com/item?id=17609063](https://news.ycombinator.com/item?id=17609063)

------
azujus
I sometimes wonder if Unix clock running out in 2038 is going to be our only
hope to solve the Great IoT DDOS war of 2030s? :)

~~~
kevin_thibedeau
We'll all be reliving the 70's.

------
acjohnson55
Pretty sure they'll figure it out. There will just be a period where both
dates are used. It'll be a little messy, but they'll survive. Definitely
learned something from the article though!

------
Isamu
How are the eras named? This will be the end of the Heisei era. I grew up in
the Showa era (apparently.)

~~~
amyjess
The Japanese emperor picks a regnal name when he takes the throne, just like
the Pope.

The name is actually the name of the emperor, not the name of the era. In
Japan, nobody uses the emperor's birth name; they just use the regnal name.
For example, nobody in Japan says "Hirohito"; they refer to him as "Emperor
Showa" instead (though nobody calls Akihito "Emperor Heisei" now, because it's
considered rude to refer to the living emperor by name... he's just "His
Majesty, the Emperor").

Note that this wasn't the case until the 19th century. Until Emperor Meiji
(Mutsuhito) took the throne in 1867, the name of the emperor and the name of
the era were completely decoupled, and the emperor would just arbitrarily
start eras whenever he felt like it. Meiji changed all this and standardized
Japan on a one-emperor, one-era system. And in 1979 (!), it actually became
law.

~~~
rspeer
Is it generally true that, if the Emperor has to refer to _himself_ by name,
he'll use his birth name?

The one case I've seen that seems this way is that the first author of this
paper on fish genetics [1] is listed as "Akihito".

[1]
[https://www.ncbi.nlm.nih.gov/pubmed/26475939](https://www.ncbi.nlm.nih.gov/pubmed/26475939)

~~~
kaybe
Oh wow, it must be insane to be co-author to the _emperor_!

From the outside it's a weird juxtaposion of a traditional, old (from a
European point of view) system of state and an everyday modern way of
conducting scientific research. You'd just not expect this kind of contact,
somehow.

~~~
Isamu
So the co-authors have an Akihito Number of 1. Does anybody on the thread have
an Akihito Number of 3 or less?

~~~
uremog
I (3) believe one of my friends (2) served one of the princesses (1) tea at a
ceremony once when they visited Hawaii.

~~~
kaybe
All of those need to publish papers with each other to qualify, probably.
Maybe we can find another measure?

[https://en.wikipedia.org/wiki/Erd%C5%91s_number](https://en.wikipedia.org/wiki/Erd%C5%91s_number)

------
_Codemonkeyism
?

" Source: Ken Whistler

Date: July 16, 2018

Background

The UTC is now working on the Unicode 12.0 release cycle. The tentative
release date that I and the Editorial Committee are working towards for that
release is March 5, 2018. "

~~~
hyperpape
I believe it's a typo, and he means 2019.

------
pcurve
what a fascinating article! the bits about Unicode needing to be updated and
also how their legacy systems were never updated for Heisei blew my mind.
Great write up!

------
dev_dull
Why not just keep counting up forever and use it like Japanese epoch time?

~~~
krapp
Starting from when, Emperor Jimmu?

~~~
dev_dull
They’ve already started with the current emperor. Basically don’t change
anything is what I’m wondering about — just keep counting up.

~~~
krapp
Setting aside whatever political and cultural pressures there might be to
maintain the status quo, this isn't just a measure of time, it's a measure of
units of imperial reigns. What does it even signify if it doesn't roll over
when a transition occurs?

------
rayiner
> For one, Akihito has been on the throne for almost the entirety of the
> information age, meaning that many systems have never had to deal with a
> switchover in era.

The writer must be 12. The last transition, in 1989, is squarely in the middle
of the information age.

~~~
lolsal
The ageist comment seems unnecessary. I've been on the 'internet' since the
80s as well, but I don't think of the internet really taking off until the
90s, so I understand what the author's comment was conveying.

