日期/時間格式
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
在飯店廣告 XML 訊息和動態饋給中使用下列日期/時間格式。
日期
日期的格式如下:
YYYY-MM-DD
YYYY
:以四位數字表示的年份
MM
:以兩位數字表示的月份
DD
:以兩位數字表示的日期
範例:2017-12-31
(2017 年 12 月 31 日)。
YearlessDate
無年份日期表示每年發生的日期事件,其格式如下:
MM-DD
MM
:以兩位數字表示的月份
DD
:以兩位數字表示的日期
範例:12-31
代表 12 月 31 日。
DateTime
DateTime 會採用 RFC 3339 格式:
YYYY-MM-DDTHH:mm[:ss.SSS]+|-HH:mm[Z]
YYYY
:以四位數字表示的年份
MM
:以兩位數字表示的月份
DD
:以兩位數字表示的日期
T
:將日期和時間分開
HH
:小時
mm
:分鐘
ss
:(選用) 秒
SSS
:(選用) 毫秒
+|-
:將日期和時間與時區偏移值分開
HH:mm
:時區偏移的小時和分鐘
Z
:(選用) 零偏移
範例:2017-12-31T16:20:00-04:00
。
您也可以指定 Z
做為時區偏移值,表示零偏移。
時間
時間的表示格式如下:
HH:MM[:SS]
例如 16:20:00
或 16:20
。
時間會以相關聯物件的當地時區解讀。
保留所有權利。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eHotel Ads XML messages and feeds use specific formats for Date, YearlessDate, DateTime, and Time.\u003c/p\u003e\n"],["\u003cp\u003eDates are expressed as YYYY-MM-DD (e.g., 2017-12-31), while YearlessDates omit the year, using MM-DD (e.g., 12-31).\u003c/p\u003e\n"],["\u003cp\u003eDateTime follows the RFC 3339 format, YYYY-MM-DDTHH:mm[:ss.SSS]+|-HH:mm[Z], including timezone offsets.\u003c/p\u003e\n"],["\u003cp\u003eTime is represented as HH:MM[:SS] (e.g., 16:20:00 or 16:20) and is interpreted in the property's local time zone.\u003c/p\u003e\n"]]],[],null,["# Date/Time Formats\n\nUse the following date/time formats in the Hotel Ads XML messages and feeds.\n\nDate\n----\n\nDates are expressed in the following format: \n\n YYYY-MM-DD\n\n- `YYYY`: Four-digit year\n- `MM`: Two-digit month\n- `DD`: Two-digit day\n\nExample: `2017-12-31` for December 31st, 2017.\n\nYearlessDate\n------------\n\nYearless dates express a date event that occurs every year, and are expressed in\nthe following format: \n\n MM-DD\n\n- `MM`: Two-digit month\n- `DD`: Two-digit day\n\nExample: `12-31` for December 31st.\n\nDateTime\n--------\n\nDateTime uses the [RFC 3339](//www.ietf.org/rfc/rfc3339.txt) format: \n\n YYYY-MM-DDTHH:mm[:ss.SSS]+\\|-HH:mm[Z]\n\n- `YYYY`: Four-digit year\n- `MM`: Two-digit month\n- `DD`: Two-digit day\n- *T*: Separates the date from the time\n- `HH`: Hours\n- `mm`: Minutes\n- `ss`: (Optional) Seconds\n- `SSS`: (Optional) Milliseconds\n- *+|-*: Separates the date and time from the timezone offset\n- `HH:mm`: Hours and minutes in the timezone offset\n- *Z*: (Optional) Zero offset\n\nExample: `2017-12-31T16:20:00-04:00`.\n\nYou can also specify `Z` for the timezone offset, which indicates zero offset.\n\nTime\n----\n\nTime is expressed in the format: \n\n HH:MM[:SS]\n\n- `HH`: Hours\n- `MM`: Minutes\n- `SS`: (Optional) Seconds\n\nExample: `16:20:00` or `16:20`.\n\nTimes are interpreted in the local time zone of the associated property."]]