All of Japan would prefer that you fix your code, to allow for the Emperor of Japan to be alive!

by Michael S. Kaplan, published on 2013/02/27 07:01 -05:00, original URI:

This was going to be the month.

The month to break the six year streak.

The streak where every month at least one person sent me email about a particular issue.

And then, a few hours ago, Marcus messed that up.

His email in part read:

My code for dealing with the Japanese calendar has run into a .NET Framework bug. How do you successfully get the end date of the fourth era?

I have to assume that Marcus isn't Japanese, and has never been to Japan, has never loved Japan.

Such a person probably wouldn't ever have asked how to "successfully get the end date of the 4th era", since the answer involves an inquest after the demise of the Emperor of Japan.

This is knowledge that no one that I know of has, and that I certainly wouldn't want Microsoft to have any special insight about or into, even if they do maintain Microsoft HealthVault!

The answer to Marcus: fix your code, to allow for the Emperor of Japan to be alive!

And then I pointed him to some blogs from Shawn that talk about the issue (Japanese Calendars, How do I Test Support for Additional Eras? and Extending the Windows Japanese Calendar Era information), so he could test out his code after he fixed it.

Now I wouldn't usually feel very comfortable speaking on behalf an entire country.

But I'll make an exception in this case! :-)

Now for the record, I've spent some time on a machine with the entire list from Wikipedia's List of Japaese Era Names on it, and ran into no significant problems with them.

Converting to and from the lunar calendar isn't that hard, Shawn! :-)

I've actually talked to some people about this in the past, and a few years ago (during a health scare about the Emperor), the CTO of Microsoft Japan sent a woman he trusted from MSKK to Redmond to discuss the unthinkable, something no one who is from Japan and who loves Japan would really want to think about: what happens when there is a new Emperor? But she did the job remarkably well, and helped everyone understand the impact on our products. I won't call her out by name because she is modest, but she was somewhat unwillingly drafted into the army of "People Who Know Things No One Is Allowed to Know", and she performed the job beautifully.

I doubt I would have fared as well stepping outside of my own comfort zone, my own conventions....

John Cowan on 27 Feb 2013 9:59 AM:

A similar question is "When is the C.E. era going to be over?"  Nobody seems to ask that one!

Technically, the Emperor could proclaim a new era whenever he feels like it.  Past Emps have done so as often as they changed underwear, it seems.  It doesn't actually have to wait for a new Emperor.

Random832 on 27 Feb 2013 11:18 AM:

Maybe there should be support for converting a date that is outside the range of an era, so if (for example) someone, in 1988, had written the future date [gregorian]2012-12-21 in a file as 昭和87年12月21日, that could properly be parsed and yield the same result as 平成24年12月21日.

Joshua on 27 Feb 2013 11:54 AM:

And how do you write a date 100 years in the future in the Japanese calender?

Michael S. Kaplan on 27 Feb 2013 12:12 PM:


Just assume the Emperor will be alive then still, and add 100 to the date!

kaorun on 28 Feb 2013 11:16 PM:

Japanese version of Word has Gengo date formatting in Field function, like { DATE \@ "ggg E年O月A日" } => 平成 二十五年三月一日. But, .net date formatter output ggg to 西暦. I think this is wrong implementation. They should be contact to Office team.

Random832 on 1 Mar 2013 11:34 AM:

And what happens 100 years from now when I want to parse it? Assuming he will be alive is less appealing if it means my program fails if he's not.

Joshua on 6 Mar 2013 9:51 AM:

Random832 caught on to the real meaning of my question. As it happens (something I suspected but did not know), future dates are invalidated whenever an emperor dies. I picked 100 years for the question so that nobody would seriously believe he'd still be alive.

Michael S. Kaplan on 6 Mar 2013 6:56 PM:

It is a matter of faith to believe he will live forever. :-)

Michael S. Kaplan on 6 Mar 2013 6:58 PM:

If Random832 were Japanese, he would know this!

Well, that's not so bad on 6 Mar 2013 11:12 PM:

After all, uture times are invalidated every time governments change time zones or summer-time rules.  The only safe approach (which is used to say when stock options expire) is to say "5 PM New York time", and that means whatever instant of Universal Time winds up corresponding to 5 PM New York time on the date specified.

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day