Prepare your application for the Japanese era change
On April 1, 2019, the new era name was announced: Reiwa (令和). On April 25, Microsoft released packages for different Windows operating systems containing the updated registry key with the new era name. Update your device and check your registry to see if it has the new key, and then test your application. Check this support article to make sure your operating system should have received the updated registry key.
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.
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
The following instructions are meant for devices that have not yet been updated with the new registry key. First check if your device contains the new registry key, and if not, test using the following instructions.
It is important to test for compatibility problems before the era has changed, and you can do so now using the new era name. To do this, add a registry key for the new era using Registry Editor:
- Navigate to Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras.
- Select Edit > New > String Value, and give it the name 2019 05 01.
- Right-click the key and select Modify.
- In the Value data field, enter 令和_令_Reiwa_R (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.
On April 1, 2019, the new era name was announced. On April 25, an update with a new registry key for supported Windows versions containing the name was released, allowing you to validate that your application handles it properly. This update is being 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:
- Open intl.cpl (search for it from the Windows search bar).
- From the Format dropdown, select Japanese (Japan).
- Select Additional settings.
- Select the Date tab.
- From the Calendar type dropdown, select 和暦 (wareki, the Japanese calendar). It should be the second option.
- Click OK.
- 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:
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:
- Right-click the date and time area in the lower-right corner of the screen.
- Select Adjust date/time.
- In the Settings app, under Change date and time, select Change.
- Change the date to on or after May 1, 2019.
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 (Reiwa, 令和).
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 SDKs at Updates for May 2019 Japan Era Change.
The following APIs will be impacted:
- Windows.Globalization Namespace
- Calendar Class
- AddDays Method
- AddEras Method
- AddHours Method
- AddMinutes Method
- AddMonths Method
- AddNanoseconds Method
- AddPeriods Method
- AddSeconds Method
- AddWeeks Method
- AddYears Method
- Era Property
- EraAsString Method
- FirstYearInThisEra Property
- LastEra Property
- LastYearInThisEra Property
- NumberOfYearsInThisEra Property
- Calendar Class
- Windows.Globalization.DateTimeFormatting Namespace
- System Namespace
- System.Globalization Namespace
- datetimeapi.h header
- winnls.h header