2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Rubyで和暦表示

Posted at

Rubyで和暦表示するメモ。

today = Time.now # 日付の取り方はちょっと適当

"平成#{today.year - 1988}年#{today.strftime('%-m')}月#{today.strftime('%-d')}日"
2
4
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?