Japanese Calendars, How do I Test Support for Additional Eras?

The Japanese Calendar is labeled by the reign of the current emporer.  Windows has supported 4 Japanese calendar Eras, however in the future there may be more eras.  Realizing this, we've added support in Windows 7, Server 2008R2 & .Net v4 for additional Japanese Eras.

There're a few things applications should know about extended Japanese Era support:

  • The first is that applications may see more than 4 eras!.
  • The current era could end
  • Future dates could change, moving from the current era to a new era.  (So "Heisei 71" could be "something 12" or something like that)
  • The era numbers themselves could change, so the 1-4 era numbers shouldn't be relied upon.

Cool, so if we're being careful about all of those things, and are pretty sure we don't have any hard-coded dependencies on the Japanese Eras or when they are, how do we test it?

On Windows 7 / Server 2008 R2 (beta) and CLRv4 (beta) Japanese era information can be found in the registry:

Windows Registry Editor Version 5.00

"1868 01 01"="明治_明_Meiji_M"
"1912 07 30"="大正_大_Taisho_T"
"1926 12 25"="昭和_昭_Showa_S"
"1989 01 08"="平成_平_Heisei_H"

Additional eras can be added just by adding an entry to the table.  The format for the value "YYYY MM DD"="JE_AJE_EE_AEE" where the first day of the era is represented in the value name by YYYY for the year (gregorian), MM for the month, and DD for the day.  The value data contains the era strings, the "full" era name, followed by the abbreviated name (in Japanese), then the full name followed by the abbreviated name in English.  Each value is seperated by _ (underscore).  So in "YYYY MM DD"="JE_AJE_EE_AEE", JE represents the Japanese Era name, AJE represents the abbreviated Japanese Era.  EE represents the English Era name, and AEE represents the abbreviated English Era name.

An example would be:

Windows Registry Editor Version 5.00

"1868 01 01"="明治_明_Meiji_M"
"1912 07 30"="大正_大_Taisho_T"
"1926 12 25"="昭和_昭_Showa_S"
"1989 01 08"="平成_平_Heisei_H"
"20219 05 01"="仮名_仮_Test Era_X"

(I'm not trying to make any predictions with the 2019, it's just a test number 🙂  Also remember this only works in Windows 7 and other newer products.

[Edited:  This is intended to support the possibility of a future era, not to enable older eras.  There's the potential that lots of stuff won't work correctly if eras prior to the existing 4 are added].  Also note that this registry key is pretty flexible.  If you want you could add a bunch of data for a bunch of eras < 1868.  (I don't have the data.)  That might break more stuff because then "Era 1" would turn into "Era 8" or something.  (Which is why I said not to depend on the Era number, it's pretty meaningless and arbitrary for us).  As noted, we only really intended to support adding new eras, not the historical ones.  Prior to 1870 or so the calendar was lunar not gregorian based, so conversions prior to then are pretty meaningless anyway.


Hope this is interesting,





Comments (4)
  1. Kindaichi says:

    The actual relevance of traditional eras has been shrinking since the mid 20th century. Most Japanese memorize the era year of their birth, but are often troubled to remember what the current era year is, and may likely be off by a year or too if asked. (Many people use the Word functional to insert the date just to figure out what year it is when needed.)

    Focusing on support for future eras is of only questionable marginal value. Rather there should be much more extensive support for historical eras. In a historical context they are extremely important. So much that it is more common to talk about history in terms of the era, with a Gregorian year in parentheses only as a nice afterthought, if given at all.

    The other thing to note is that a new era year does NOT necessarily, and usually will not, begin on January 1st. So a single Gregorian year may fall on two separate traditional eras.

    Just for reference, Wikipedia has quite an extensive amount of info on the Japanese eras, often with sub-entries for specific entries:


  2. John Cowan says:

    It’s easily gleaned from here:


    Unless I counted wrong, your Era 1 (Meiji) is really Era 246.  Note that there are some periods with no eras, and most early eras were short.

  3. Thanks for the wikipedia pointer, I didn’t see the dates though, just the years.  Just to be clear, Japanese eras in Windows/.Net do start on the correct date (for the eras we support).  As noted, it’s not usually January 1.  My understanding is that dates are sometimes seen with the earlier or later era during a transition year.

    The range of usage is interesting.  Certainly the Japanese Calendar is probably more interesting for historical data.  However on the other hand people are concerned with contemporary holiday dates, etc. and most computer systems handle reasonably modern years.

    So dates in general on a computer (Japanese or Gregorian or any other calendar) are more likely to be within a hundred years or so.  Generalized date APIs often aren’t sufficient for historical data, and such apps often have other mechanisms.  (Not suggesting those are less important, just there’s a lot more need for contemporary dates on a computer.)

    The intersection of the usefulness of somewhat recent dates for most applications, and the usefulness of the Japanese calendar for older dates is interesting.

    It’s worth noting that other calendars are also restricted in their range, either by being fairly recent (Taiwan), or by having unpredictable futures (Hijri, Japanese Eras.)

    FWIW: We haven’t really had complaints about the range of Japanese Era support.  However if you want to stick the entire list from Wikipedia in the registry, it should work on Win7/.Net v4 (beta).

  4. By the way, older eras are pretty impractical anyway since prior to the supported in-box dates the Japanese calendar used a luner type system instead of Gregorian.  So accurate conversion of dates prior to the 1870s or so isn’t possible with these APIs anyway.

Comments are closed.

Skip to main content