Last active
April 1, 2019 23:52
-
-
Save rh-KIMATA/896b67928942566a9569bfa0c2ab0e18 to your computer and use it in GitHub Desktop.
Registry editing to Japanese ”Reiwa” era support.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get | |
Get-Item -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras'; | |
# Add | |
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras' -Name '2019 05 01' -Value '令和_令_Reiwa_R'; | |
# Edit | |
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras' -Name '2019 05 01' -Value '令和_令_Reiwa_R'; | |
# Remove | |
Remove-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Calendars\Japanese\Eras' -Name '2019 05 01'; | |
# Display | |
[CultureInfo] $culture = [CultureInfo]::New("ja-JP"); | |
[Globalization.JapaneseCalendar] $culture.DateTimeFormat.Calendar = [System.Globalization.JapaneseCalendar]::new(); | |
([Datetime]'2019/5/1').ToString('ggy年', $culture); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment