Skip to content
Converts between Japanese calendar and western calendar
Go Makefile Dockerfile Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/wareki
.gitignore
.travis.yml
Dockerfile
LICENSE
Makefile
README.md
README_ja.md
docker-entrypoint.sh
gengo.go
gengo_test.go
go.mod
go.sum

README.md

English | 日本語

wareki

Build Status MIT License GoDoc Go Report Card Version

wareki converts between Japanese calendar and western calendar.

Description

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.

Usage

$ 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

Installation

Developer

$ go get -u github.com/ebc-2in2crc/wareki/...

User

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

Contribution

  1. Fork this repository
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

Licence

MIT

Author

ebc-2in2crc

You can’t perform that action at this time.