Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@anozon

日付や時間を一瞬で入力する2つの方法

ファイル名や記事に今のタイムスタンプを入力したいときに「2018/10/20」なんて手動で打つ必要はないです。

Google IME を使う

「きょう」と「いま」の変換で4種類ほど変換できます。

Fullscreen_2018_10_20_20_53.png

moment-cli を使う

もう少しカスタマイズしたフォーマットを使いたい人はこちら。

cpsubrian/node-moment-cli: CLI for printing dates via momentjs.

npm install -g moment-cli

使い方

$ moment -f "YYYY-MM-DD"
2018-10-20

$ moment -f "YYYY-MM-DD HH:mm:ss"
2018-10-20 20:59:35

$ # クリップボードにコピー
$ moment -f "YYYY-MM-DD HH:mm:ss" |pbcopy
$ alias -g C='| pbcopy'
$ moment -f "H時" C
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?