DateTime
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
JSON 表現 |
{
"date": string
} |
フィールド |
date |
string
ISO 8601 拡張形式の日付/時刻。オフセットは必須の場合と不要な場合があります(親フィールドのドキュメントをご覧ください)。時刻はナノ秒単位の精度で指定できます。オフセットは秒の精度で指定できます(オフセット秒は ISO 8601 の一部ではありません)。 例: 1985-04-12T23:20:50.52Z は UTC で 1985 年 4 月 12 日の 23 時 20 分 50.52 秒になります。
1985-04-12T19:20:50.52-04:00 は、1985 年 4 月 12 日の 19 時から 20 分 50.52 秒、つまり UTC の 4 時間前(上記の例と同じ時刻)になります。日付/時刻がニューヨークの物理的な場所を対象とする場合、これは東部夏時間(EDT)に相当します。夏時間(またはサマータイム)が適用される地域では、時期に応じてオフセットが異なることに注意してください。
1985-04-12T19:20:50.52 は、オフセット情報なしで、1985 年 4 月 12 日の 19 時から 20 分 50.52 秒になります。
オフセットを指定すると、全世界の時刻でその時点になります。日時は、ユーザーのタイムゾーンに基づいて調整されます。たとえば、時刻が 2018-06-19T18:30:00-04:00 の場合、ニューヨークのユーザーの場合は 18:30:00、ロサンゼルスのユーザーの場合は 15:30:00 になります。 オフセットを省略すると、ローカルの日付/時刻になり、世界中のいくつかの時刻を表します。日時は常にユーザーの現在のタイムゾーンで行われます。たとえば、時刻が 2018-06-19T18:30:00 の場合、ニューヨークのユーザーの場合は 18:30:00、ロサンゼルスのユーザーの場合は 18:30:00 になります。これは、同じローカルの日付/時刻を、複数のタイムゾーンにわたる多数の物理的な場所に適用する場合に便利です。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[[["\u003cp\u003eThe JSON schema represents a date object.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edate\u003c/code\u003e field is a string that adheres to the ISO 8601 extended format for date and time.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edate\u003c/code\u003e field can include an offset to specify the time zone, or it can be omitted for local time representation.\u003c/p\u003e\n"],["\u003cp\u003eProviding an offset ensures the \u003ccode\u003edate\u003c/code\u003e represents a specific instant in time globally, while omitting it makes it a local time subject to user time zones.\u003c/p\u003e\n"]]],["The core information defines the `date` field within a JSON structure. The `date` is a string representing an ISO 8601 date/time, with optional offset information. It may include nanosecond precision. Providing an offset creates an absolute instant in time, adjusted to the user's timezone. Omitting the offset creates a local date/time, consistent across time zones. This format can represent times down to the nanosecond and offsets with second precision.\n"],null,["# DateTime\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n\n| JSON representation |\n|----------------------------|\n| ``` { \"date\": string } ``` |\n\n| Fields ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `date` | `string` An ISO 8601 extended format date/time. Offset may or may not be required (refer to the parent field's documentation). Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601). For example: `1985-04-12T23:20:50.52Z` would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC. `1985-04-12T19:20:50.52-04:00` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the date/time is intended for a physical location in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year. `1985-04-12T19:20:50.52` would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information. Providing an offset makes this an absolute instant in time around the world. The date/time will be adjusted based on the user's time zone. For example, a time of `2018-06-19T18:30:00-04:00` will be 18:30:00 for a user in New York and 15:30:00 for a user in Los Angeles. Omitting the offset makes this a local date/time, representing several instants in time around the world. The date/time will always be in the user's current time zone. For example, a time of `2018-06-19T18:30:00` will be 18:30:00 for a user in New York and also 18:30:00 for a user in Los Angeles. This is useful when the same local date/time should apply to many physical locations across several time zones. |"]]