DateTime
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
JSON 表示法 |
{
"date": string
} |
欄位 |
date |
string
採用 ISO 8601 擴充格式的日期/時間,不一定要有偏移 (請參閱父項欄位的說明文件)。時間的精確度可以指定到奈秒。指定偏移值時可以使用秒精確度 (即使偏移秒數並非 ISO 8601 的一部分)。 例如: 1985-04-12T23:20:50.52Z 是世界標準時間 1985 年 4 月 12 日 23 時 20 分 50.52 秒。
1985-04-12T19:20:50.52-04:00 是世界標準時間 1985 年 4 月 12 日 19 時 20 分 50.52 秒,比世界標準時間慢 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。如果不同時區中的許多實際地點都應套用相同的當地日期/時間,這種做法就非常實用。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\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. |"]]