次の方法で共有


Extending the Windows Japanese Calendar Era information.

Some people have asked whether Windows supports new Japanese Calendar Emperor eras if that becomes necessary.  FWIW That information is stored in the registry on Win7/Win8/.Net4.0+:

 

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCalendarsJapaneseEras

There are string values for each of the supported eras.  Each value is named with the start date of the era in yyyy MM dd format, such as "1989 01 08" for the Era starting on January 8, 1989.  The data for each value is a string, with the Japanese Era name, both full, and abbreviated, and then English full and abbreviated names.  Those are delimited by underscores.  For example: "平成_平_Heisei_H".

Though you may not need a new era yet, it's possible to add a key if you want to, for example, to test and make sure your software won't break if another era gets added.

I blogged about that in more detail earlier at: https://blogs.msdn.com/b/shawnste/archive/2009/09/24/japanese-calendars-how-do-i-test-support-for-additional-eras.aspx

Comments

  • Anonymous
    December 11, 2011
    I noticed the first date for 明治 era starts from 1868/01/01. But actually the date should starts from 1868/09/08, why Microsoft set it be such a wrong date?

  • Anonymous
    January 26, 2012
    The API allows either Era for the year during the transition.  I'm not sure about the earlier date, I think there's a little bit of disparity in how some of the APIs handle the beginning.   PS: If you're actually experimenting with modifying the era information, I'd be curious about your results :)

  • Anonymous
    February 12, 2012
    I tried this out. I set the string name to "2012 02 01" and the data to "大悟_大_Daigo_D". ("Great Enlightenment") The date in the Date and Time window is updated to use this. Also, if I then click on "Change date and time...", here too it is updated. However, upon floating the mouse above the clock, the popup still shows 平成24. Also, the same if I single click the clock to get the clock popup. These are the two windows that I would typically check most frequently for the date/time. Looks like some more QA is needed here. May I assume that Office 2010 uses its own built-in functionality? It does not pick up the changes at all. By the way, the emperor will soon be undergoing bypass heart surgery.

  • Anonymous
    February 13, 2012
    Office doesn't read this key, I'll report it to them.  I'm unable to reproduce your symptoms on Windows 7 or Windows 8 with the clock in the tray.  I see the correct date in the tray, in the popup, and in the date/time changing dialog.  If you can provide more information that'd be great.  (You can use the email blog author page if you want).  Though I did not need to log off or reboot, does it start behaving if you reboot?