DateTime
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
การแสดง JSON |
{
"date": string
} |
ช่อง |
date |
string
วันที่/เวลาในรูปแบบ ISO 8601 แบบขยาย อาจต้องใช้ออฟเซ็ตหรือไม่ก็ได้ (โปรดดูเอกสารของช่องหลัก) สามารถระบุเวลาได้ละเอียดถึงระดับนาโนวินาที คุณสามารถระบุค่าออฟเซ็ตด้วยความแม่นยำของวินาที (แม้ว่าวินาทีออฟเซ็ตจะไม่ได้เป็นส่วนหนึ่งของ ISO 8601 ก็ตาม) เช่น 1985-04-12T23:20:50.52Z จะใช้เวลา 20 นาที 50.52 วินาทีหลังจาก 23 ชั่วโมงของวันที่ 12 เมษายน 1985 ในเขตเวลา UTC
1985-04-12T19:20:50.52-04:00 จะเป็น 20 นาที 50.52 วินาทีหลังจากชั่วโมงที่ 19 ของวันที่ 12 เมษายน 1985 เป็นเวลา 4 ชั่วโมงก่อน UTC (ทันทีเหมือนกับตัวอย่างด้านบน) หากตั้งใจระบุวันที่/เวลาสำหรับสถานที่จริงในนิวยอร์ก วันที่/เวลานี้จะเทียบเท่ากับเวลาออมแสงตะวันออก (EDT) โปรดทราบว่าออฟเซ็ตจะแตกต่างกันไปในภูมิภาคที่ใช้เวลาออมแสง (หรือฤดูร้อน) โดยขึ้นอยู่กับช่วงเวลาของปี
1985-04-12T19:20:50.52 จะเป็น 20 นาที 50.52 วินาทีหลังจาก 19 ชั่วโมงของวันที่ 12 เมษายน 1985 โดยไม่มีข้อมูลออฟเซ็ต
การให้ค่าชดเชยทำให้เรื่องนี้เกิดขึ้นทันทีทันใดทั่วโลก ระบบจะปรับวันที่/เวลาตามเขตเวลาของผู้ใช้ ตัวอย่างเช่น เวลาของ 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. |"]]