Core HTML

HTML Datetime Formats Table

Datetime Attribute Formats
Type Format Example Strings Description
Year YYYY
     Y - year digit
1917 The year A.D. 1917
Month YYYY-MM
     Y - year digit
     M - month digit
1917-10 October of A.D. 1917
Week YYYY-Www
     Y - year digit
     W - week indicator
     w - week digit
1917-W42 The 42nd week of A.D. 1917
Date YYYY-MM-DD
     Y - year digit
     M - month digit
     D - day digit
1776-07-04 July 4, A.D. 1776
Local Date and Time YYYY-MM-DDThh:mm:ssd
     Y - year digit
     M - month digit
     D - day digit
     T or space - time indicator
     h - hour digit
     m - minute digit
     s - second digit
     d - optional decimal portion
1917-10-13T12:00:34.742
1917-10-13 12:00:34.742
October 13, A.D. 1917 at 34.742 seconds after 12 p.m.
Global Date and Time YYYY-MM-DDThh:mm:ssdz
     Y - year digit
     M - month digit
     D - day digit
     T or space - time indicator
     h - hour digit
     m - minute digit
     s - second digit
     d - optional decimal portion
     z - time zone
1917-10-13T12:00:00Z
1917-10-13T12:00:00-05:00
1917-10-13T12:00:00-0400
October 13, A.D. 1917 at 12 p.m. Greenwich Mean Time
October 13, A.D. 1917 at 12 p.m. Eastern Standard Time
October 13, A.D. 1917 at 12 p.m. Eastern Daylight Time
Time hh:mm:ssd
     h - hour digit
     m - minute digit
     s - second digit
     d - optional decimal portion
00:05:23.94
5 minutes and 23.94 seconds after midnight
Day MM-DD
     M - month digit
     D - day digit
04-24 April 24th
Period of Time (-)PxYxMxDTxHxMxS
     (-) - optional negative
     P - period indicator
     Y - year indicator
     M - month indicator
     D - day indicator
     T - time indicator
     H - hour indicator
     M - minute indicator
     S - second indicator
P10D
PT1H30M
-PT15S
P2Y3MT5H40S
P3M
PT3M
P10DT3H15M
10 days
1 hour and 30 minutes
-15 seconds
2 years, 3 months, 5 hours, and 40 seconds
3 months
3 minutes
10 days, 3 hours, and 15 minutes
 
 

© 2007–2024 XoaX.net LLC. All rights reserved.