diff --git a/files/en-us/web/api/htmltimeelement/datetime/index.md b/files/en-us/web/api/htmltimeelement/datetime/index.md index 4f3362fcba17895..7a2fe1f396a67e2 100644 --- a/files/en-us/web/api/htmltimeelement/datetime/index.md +++ b/files/en-us/web/api/htmltimeelement/datetime/index.md @@ -13,144 +13,9 @@ The property is a string that reflects the [`datetime`](/en-US/docs/Web/HTML/Element/time#datetime) HTML attribute, containing a machine-readable form of the element's date and time value. -The format of the string must follow one of the following HTML microsyntaxes: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MicrosyntaxDescriptionExamples
Valid month stringYYYY-MM2011-11, 2013-05
Valid date stringYYYY-MM-DD1887-12-01
Valid yearless date stringMM-DD11-12
Valid time string - HH:MM
HH:MM:SS
HH:MM:SS.mmm -
- 23:59
12:15:47
12:15:52.998 -
Valid local date and time string - YYYY-MM-DD - HH:MM
YYYY-MM-DD HH:MM:SS
YYYY-MM-DD HH:MM:SS.mmm
YYYY-MM-DDTHH:MM
YYYY-MM-DDTHH:MM:SS
YYYY-MM-DDTHH:MM:SS.mmm -
- 2013-12-25 11:12
1972-07-25 13:43:07
1941-03-15 - 07:06:23.678
2013-12-25T11:12
1972-07-25T13:43:07
1941-03-15T07:06:23.678
-
Valid time-zone offset string - Z
+HHMM
+HH:MM
-HHMM
-HH:MM -
- Z
+0200
+04:30
-0300
-08:00
-
Valid global date and time string - Any combination of a valid local date and time string followed by a - valid time-zone offset string - - 2013-12-25 11:12+0200
1972-07-25 13:43:07+04:30
1941-03-15 - 07:06:23.678Z
2013-12-25T11:12-08:00
-
Valid week stringYYYY-WWW2013-W46
Four or more ASCII digitsYYYY2013, 0001
Valid duration string - PdDThHmMsS
PdDThHmMs.XS
PdDThHmMs.XXS
PdDThHmMs.XXXS
PThHmMsS
PThHmMs.XS
PThHmMs.XXS
PThHmMs.XXXS
ww dd hh mm ss -
- P12DT7H12M13S
P12DT7H12M13.3S
P12DT7H12M13.45S
P12DT7H12M13.455S
PT7H12M13S
PT7H12M13.2S
PT7H12M13.56S
PT7H12M13.999S
7d - 5h 24m 13s
-
- ## Value -A string. +A string. For valid string formats, see the [`datetime` valid values](/en-US/docs/Web/HTML/Element/time#valid_datetime_values). ## Examples diff --git a/files/en-us/web/html/element/time/index.md b/files/en-us/web/html/element/time/index.md index 18d47a9b5acc4f5..8a0794413c1d09f 100644 --- a/files/en-us/web/html/element/time/index.md +++ b/files/en-us/web/html/element/time/index.md @@ -34,46 +34,129 @@ The _datetime value_ (the machine-readable value of the datetime) is the value o ### Valid datetime values -- a valid year string - - : `2011` -- a valid month string - - : `2011-11` -- a valid date string - - : `2011-11-18` -- a valid yearless date string - - : `11-18` -- a valid week string - - : `2011-W47` -- a valid time string - - - : `14:54` - - `14:54:39` - - `14:54:39.929` - -- a valid local date and time string - - - : `2011-11-18T14:54:39.929` - - `2011-11-18 14:54:39.929` - -- a valid global date and time string - - - : `2011-11-18T14:54:39.929Z` - - `2011-11-18T14:54:39.929-0400` - - `2011-11-18T14:54:39.929-04:00` - - `2011-11-18 14:54:39.929Z` - - `2011-11-18 14:54:39.929-0400` - - `2011-11-18 14:54:39.929-04:00` - -- a valid duration string - - : `PT4H18M3S` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionMicrosyntaxExamples
Valid month stringYYYY-MM2011-11, 2013-05
Valid date stringYYYY-MM-DD1887-12-01
Valid yearless date stringMM-DD11-12
Valid time string + HH:MM
+ HH:MM:SS
+ HH:MM:SS.mmm +
+ 23:59
+ 12:15:47
+ 12:15:52.998 +
Valid local date and time string + YYYY-MM-DDHH:MM
+ YYYY-MM-DD HH:MM:SS
+ YYYY-MM-DD HH:MM:SS.mmm
+ YYYY-MM-DDTHH:MM
+ YYYY-MM-DDTHH:MM:SS
+ YYYY-MM-DDTHH:MM:SS.mmm +
+ 2013-12-25 11:12
+ 1972-07-25 13:43:07
+ 1941-03-15 07:06:23.678
+ 2013-12-25T11:12
+ 1972-07-25T13:43:07
+ 1941-03-15T07:06:23.678 +
Valid time-zone offset string + Z
+ +HHMM
+ +HH:MM
+ -HHMM
+ -HH:MM +
+ Z
+ +0200
+ +04:30
+ -0300
+ -08:00 +
Valid global date and time string + Any combination of a valid local date and time string followed by a + valid time-zone offset string + + 2013-12-25 11:12+0200
+ 1972-07-25 13:43:07+04:30
+ 1941-03-15 07:06:23.678Z
+ 2013-12-25T11:12-08:00 +
Valid week stringYYYY-WWW2013-W46
Four or more ASCII digitsYYYY2013, 0001
Valid duration string + PdDThHmMsS
+ PdDThHmMs.XS
+ PdDThHmMs.XXS
+ PdDThHmMs.XXXS
+ PThHmMsS
+ PThHmMs.XS
+ PThHmMs.XXS
+ PThHmMs.XXXS
+ ww dd hh mm ss +
+ P12DT7H12M13S
+ P12DT7H12M13.3S
+ P12DT7H12M13.45S
+ P12DT7H12M13.455S
+ PT7H12M13S
+ PT7H12M13.2S
+ PT7H12M13.56S
+ PT7H12M13.999S
+ 7d 5h 24m 13s +
## Examples