Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2912

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

$
0
0

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

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

こんな感じ、日本だから +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

完成!


Viewing all articles
Browse latest Browse all 2912

Trending Articles