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

日時のフォーマット(ISO 8601)

More than 1 year has passed since last update.

日付や時間の情報をやり取りするフォーマットはいくつも存在します。
APIなどで利用するのにシンプルで分かりやすいものは ISO 8601 です。

ISO 8601

Format Time zone Sample Sample2
yyyy-MM-ddTHH:mm:ss 日本標準時(JST) 2014-10-10T13:50:40+09:00 20141010T135040+0900
~ 協定世界時(UTC) 2014-10-10T04:50:40Z 20141010T045040Z

ISO 8601 の中でも書き方は色々とありますが

  • 年月日と時間
  • タイムゾーンに対応
  • 年は4桁(2桁では年が確定できない)
  • 単位は秒まで(ミリ秒も可能だが桁数が定まっていないため)

という条件から利用しやすいフォーマットです。

利用実例

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
ユーザーは見つかりませんでした