LoginSignup
0
0

More than 3 years have passed since last update.

date コマンドで UTC な現在時刻を time zone designator を Z の iso8601 で出力

Last updated at Posted at 2020-01-22

date コマンドで local time を iso8601 で表示すると

date --iso-8601="seconds"
2020-01-22T14:56:44+09:00

こんな感じ、time zone は日本だから +09:00

これを UTC で表示すると

date --iso-8601="seconds" --utc
2020-01-22T05:57:37+00:00

たしかに +00:00 なんだろうけどここは Z と出してほしい

echo `date '+%Y-%m-%dT%H:%M:%S' --utc`Z
2020-01-22T05:58:22Z

完成!

0
0
0

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
0
0