wareki
converts between Japanese calendar and western calendar.
wareki
converts between Japanese calendar and western calendar.
When converting from the Western calendar to the Japanese calendar, the era of the Japanese calendar is automatically determined according to the Western calendar. The year of Western calendar can be omitted and the default value is the system date.
By default, the Japanese era is output with one uppercase letter (e.g. R
) but can also be output with kanji (e.g. 令和
)
You can also convert from Japanese calendar to Western calendar by specifying an option.
wareki
support Reiwa, Heisei, Taisho, Meiji.
$ date "+%Y/%m/%d"
2019/05/01
$ wareki
R1
$ wareki --kanji
令和1
$ wareki 2018
H30
$ wareki 2019/05/01
R1
$ wareki 2019/04/30
H31
$ wareki --reiwa 1
2019
$ wareki --heisei 1
1989
$ wareki --heisei 1
1989
$ wareki --showa 1
1926
$ wareki --help
# ...
Or, you can use Docker.
$ date "+%Y/%m/%d"
2019/05/01
$ docker container run --rm ebc2in2crc/wareki
R1
$ docker container run --rm ebc2in2crc/wareki --kanji
令和1
Go 1.16 or later.
$ go install github.com/ebc-2in2crc/wareki/cmd/wareki@latest
Go 1.15.
$ go get -u github.com/ebc-2in2crc/wareki/...
Download from the following url.
Or, you can use Homebrew (Only macOS).
$ brew tap ebc-2in2crc/wareki
$ brew install wareki
Or, you can use Docker.
$ docker pull ebc2in2crc/wareki
$ docker container run ebc2in2crc/wareki
R4
- Fork this repository
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Rebase your local changes against the master branch
- Run test suite with the go test ./... command and confirm that it passes
- Run gofmt -s
- Create new Pull Request