letter | Date or Time Component | Presentation | Examples |
---|---|---|---|
G | Era designator | Text | AD |
y | Year | Year | 1996; 96 |
Y | Week year | Yea | r 2009; 09 |
M | Month in year | Month | July; Jul; 07 |
w | Week in year | Number | 27 |
W | Week in month | Number | 2 |
D | Day in year | Number | 189 |
d | Day in month | Number | 10 |
F | Day of week in month | Number | 2 |
E | Day name in week | Text | Tuesday; Tue |
u | Day number of week (1 = Monday, ..., 7 = Sunday) | Number | 1 |
a | Am/pm marker | Text | PM |
H | Hour in day (0-23) | Number | 0 |
k | Hour in day (1-24) | Number | 24 |
K | Hour in am/pm (0-11) | Number | 0 |
h | Hour in am/pm (1-12) | Number | 12 |
m | Minute in hour | Number | 30 |
s | Second in minute | Number | 55 |
S | Millisecond | Number | 978 |
z | Time zone | General time zone | Pacific Standard Time; PST; GMT-08:00 |
Z | Time zone | RFC 822 time zone | -0800 |
X | Time zone | ISO 8601 time zone | -08; -0800; -08:00 |
中文版ci
字母 | 日期或時間元素 | 表示 | 示例 |
---|---|---|---|
G | Era 標誌符 | Text | AD |
y | 年 | Year | 1996; 96 |
M | 年中的月份 | Month July; | Jul; 07 |
w | 年中的週數 | Number | 27 |
W | 月份中的週數 | Number | 2 |
D | 年中的天數 | Number | 189 |
d | 月份中的天數 | Number | 10 |
F | 月份中的星期 | Number | 2 |
E | 星期中的天數 | Text | Tuesday; Tue |
a | Am/pm 標記 | Text | PM |
H | 一天中的小時數(0-23) | Number | 0 |
k | 一天中的小時數(1-24) | Number | 24 |
K | am/pm中的小時數(0-11) | Number | 0 |
h | am/pm 中的小時數(1-12) | Number | 12 |
m | 小時中的分鐘數 | Number | 30 |
s | 分鐘中的秒數 | Number | 55 |
S | 毫秒數 | Number | 978 |
z | 時區 | General time zone | Pacific Standard Time; PST; GMT-08:00 |
Z | 時區 | RFC 822 time zone | -0800 |