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

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@UedaTakeyuki

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

More than 1 year has passed since last update.

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
Help us understand the problem. What is going on with this article?
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
UedaTakeyuki
Je suis un chien errant très dangereux 🐶, Dr. en ingénierie de l'information très sage 👴, aussi l'apprenti "tinker" trop malhabile 👨‍🔧.

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?