Prepare your application for the Japanese era change

The Japanese calendar is divided into eras, and for most of the modern age of computing, we've been in the Heisei era; however on May 1, 2019, a new era will begin. Because this is the first time in decades for an era to change, software that supports the Japanese calendar will need to be tested to ensure it will function properly when the new era begins.

In the following sections, you will learn what you can do to prepare and test your application for the upcoming new era.

Note

We recommend that you use a test machine for this, because the changes you make will impact the behavior of the entire machine.

Add a registry key for the new era

It is important to test for compatibility problems before the era has changed, and you can do so now using a placeholder name. To do this, add a registry key for the new era using Registry Editor:

  1. Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras.
  2. Select Edit > New > String Value, and give it the name 2019 05 01.
  3. Right-click the key and select Modify.
  4. In the Value data field, enter ??_?_??????_? (you can copy and paste from here to make it easier).

See Era Handling for the Japanese Calendar to read more about the format for these registry keys.

Once the new era name is announced, an update with a new registry key for supported Windows versions will contain the name, and you can validate that your application handles it properly. This update will be propagated to supported earlier releases of Windows 10, as well as Windows 8 and 7.

You can delete your placeholder registry key once you're finished testing your application. This will ensure it doesn't interfere with the new registry key that will be added when Windows is updated.

Change your device's calendar format

Once you've added the registry key for the new era, you need to configure your device to use the Japanese calendar. You don't need to have a Japanese-language device to do this. For thorough testing, you may want to install the Japanese language pack as well, but it isn't required for basic testing.

To configure your device to use the Japanese calendar:

  1. Open intl.cpl (search for it from the Windows search bar).
  2. From the Format dropdown, select Japanese (Japan).
  3. Select Additional settings.
  4. Select the Date tab.
  5. From the Calendar type dropdown, select 和暦 (wareki, the Japanese calendar). It should be the second option.
  6. Click OK.
  7. Click OK in the Region window.

Your device should now be configured to use the Japanese calendar, and it will reflect whichever eras are in the registry. Below is an example of what you might see now in the lower-right corner of the screen:

Date and time in Japanese calendar format

Adjust your device's clock

To test that your application works with the new era, you must advance your computer's clock to May 1, 2019 or later. The following instructions are for Windows 10, but Windows 8 and 7 should work similarly:

  1. Right-click the date and time area in the lower-right corner of the screen.
  2. Select Adjust date/time.
  3. In the Settings app, under Change date and time, select Change.
  4. Change the date to on or after May 1, 2019.

Note

You may not be able to change the date based on organization settings; if this is the case, talk to your admin. Alternatively, you can edit your placeholder registry key to have a date that has already passed.

Test your application

Now, test out how your application handles the new era. Check places where the date is displayed, such as timestamps and date pickers. Make sure that the era is correct before May 1, 2019 (Heisei, 平成) and after (??).

Gannen (元年)

The format for the Japanese calendar is generally <Era name> <Year of era>. For example, the year 2018 is Heisei 30 (平成30年). However, the first year of an era is special; instead of being <Era name> 1, it is <Era name> 元年 (gannen). So, the first year of the Heisei era would be 平成元年 (Heisei gannen). Make sure that your application properly handles the first year of the new era, and correctly outputs ??元年.

There are several WinRT, .NET, and Win32 APIs that will be updated to handle the era change, so if you use them, you shouldn't have to worry too much. However, even if you do rely entirely on these APIs, it's still a good idea to test your application and make sure you get the desired behavior, especially if you are doing anything special with them like parsing.

You can follow along with updates to the OS and SDK's at Updates for May 2019 Japan Era Change.

The following APIs will be impacted:

WinRT

.NET

Win32

See also