Gannen vs Ichinen

What is 元年 (Gannen)?

With the upcoming new Japanese Calendar Era comes a new "year 1" for the new era. Traditionally the first year of an era is labeled "元年" (gannen), which differs from the numbered year "1年" (ichinen). "Gannen" can be loosely translated as "the first year of the era", presuming the era is already stated in the date.

For example in the date "‎平成‎30‎年‎10月‎31‎日" - 平成‎ is the Era name (currently Heisei), 30 is the year number, "年" is "year", 10 is the month number (October), "月" is "month", 31 is the date, and "日" is "day".

However, for the first year of an era, 元年 is preferred, so a similar date would look like 平成‎‎元年‎10月‎31‎日.

Note that "gan" by itself doesn't have the context and needs the "nen" syllable, so something like 1/9/1 would remain numeric instead of 元/9/1. Additionally, gannen requires the context of an era, so 元年‎10月‎31‎日 would be underspecified; "First year of what?"  The era name is required to make sense to readers.

元年 (Gannen) in Windows

Since 元年 is the preferred spelling of the first year, the latest Windows 10 Insider Builds 18272 and above will by default use the 元年 instead of 1年 at the beginning of each era (so long as the Era name and 年 character are included in the date format.)

The gannen behavior is enabled by default in updated Windows.Globalization and Win32 NLS APIs.  This provides that when the new era is used next year, then the year will be correctly displayed as 元年.

Since this change my disrupt applications that haven't previously seen the 元年 (gannen) spelling, it can be enabled or disabled by a registry value.

When enabled, date formats including the era name and year character will display the first year of the era as 平成. Applications using the Windows.Globalization date formatting APIs and the Win32 GetDateFormatA/W/Ex APIs will exhibit this behavior.

To disable the gannen (元年) behavior and use ichinen (1年) instead, set this registry value:

 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese
"InitialEraYear"="1年"

元年 (Gannen) and Apps

With Windows returning the 元年 string for the first year of an era, applications that merely use the OS APIs for formatting should hopefully behave fine. However, apps that do their own parsing of the OS formatted strings or otherwise manipulate the year value may need to be updated to accept the 元年 as well as 1年.