Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

ファイル名や記事に今のタイムスタンプを入力したいときに「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
anozon
Webエンジニア TS + Redux, Firebase , DevOps好き, 趣味でCentOSやRaspberryPIやサーバー管理
https://anozon.me
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした