Skip to content

Commit

Permalink
Remove HTMLTimeElement: dateTime syntax table, move it to <time> (#35453
Browse files Browse the repository at this point in the history
)

* Remove HTMLTimeElement: dateTime syntax table, move it to <time>

* Update files/en-us/web/html/element/time/index.md

Co-authored-by: Dipika Bhattacharya <[email protected]>

* Update index.md

* Update files/en-us/web/html/element/time/index.md

---------

Co-authored-by: Dipika Bhattacharya <[email protected]>
  • Loading branch information
Josh-Cena and dipikabh authored Aug 15, 2024
1 parent 39a279d commit 835c199
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 176 deletions.
137 changes: 1 addition & 136 deletions files/en-us/web/api/htmltimeelement/datetime/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<table class="no-markdown">
<thead>
<tr>
<th scope="col">Microsyntax</th>
<th scope="col">Description</th>
<th scope="col">Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td>Valid month string</td>
<td><em>YYYY</em><code>-</code><em>MM</em></td>
<td><code>2011-11</code>, <code>2013-05</code></td>
</tr>
<tr>
<td>Valid date string</td>
<td><em>YYYY</em><code>-</code><em>MM</em><code>-</code><em>DD</em></td>
<td><code>1887-12-01</code></td>
</tr>
<tr>
<td>Valid yearless date string</td>
<td><em>MM</em><code>-</code><em>DD</em></td>
<td><code>11-12</code></td>
</tr>
<tr>
<td>Valid time string</td>
<td>
<em>HH</em><code>:</code><em>MM</em><br /><em>HH</em><code>:</code
><em>MM</em><code>:</code><em>SS</em><br /><em>HH</em><code>:</code
><em>MM</em><code>:</code><em>SS</em><code>.</code><em>mmm</em>
</td>
<td>
<code>23:59</code><br /><code>12:15:47</code><br /><code
>12:15:52.998</code
>
</td>
</tr>
<tr>
<td>Valid local date and time string</td>
<td>
<em>YYYY</em><code>-</code><em>MM</em><code>-</code><em>DD</em>
<em>HH</em><code>:</code><em>MM</em><br /><em>YYYY</em><code>-</code
><em>MM</em><code>-</code><em>DD</em> <em>HH</em><code>:</code
><em>MM</em><code>:</code><em>SS</em><br /><em>YYYY</em><code>-</code
><em>MM</em><code>-</code><em>DD</em> <em>HH</em><code>:</code
><em>MM</em><code>:</code><em>SS</em><code>.</code><em>mmm</em><br /><em
>YYYY</em
><code>-</code><em>MM</em><code>-</code><em>DD</em><code>T</code
><em>HH</em><code>:</code><em>MM</em><br /><em>YYYY</em><code>-</code
><em>MM</em><code>-</code><em>DD</em><code>T</code><em>HH</em
><code>:</code><em>MM</em><code>:</code><em>SS</em><br /><em>YYYY</em
><code>-</code><em>MM</em><code>-</code><em>DD</em><code>T</code
><em>HH</em><code>:</code><em>MM</em><code>:</code><em>SS</em
><code>.</code><em>mmm</em>
</td>
<td>
<code
>2013-12-25 11:12<br />1972-07-25 13:43:07<br />1941-03-15
07:06:23.678<br />2013-12-25T11:12<br />1972-07-25T13:43:07<br />1941-03-15T07:06:23.678</code
>
</td>
</tr>
<tr>
<td>Valid time-zone offset string</td>
<td>
<code>Z</code><br /><code>+</code><em>HHMM</em><br /><code>+</code
><em>HH</em><code>:</code><em>MM</em><br /><code>-</code><em>HHMM</em
><br /><code>-</code><em>HH</em><code>:</code><em>MM</em>
</td>
<td>
<code>Z<br />+0200<br />+04:30<br />-0300<br />-08:00</code>
</td>
</tr>
<tr>
<td>Valid global date and time string</td>
<td>
<em
>Any combination of a valid local date and time string followed by a
valid time-zone offset string</em
>
</td>
<td>
<code
>2013-12-25 11:12+0200<br />1972-07-25 13:43:07+04:30<br />1941-03-15
07:06:23.678Z<br />2013-12-25T11:12-08:00</code
>
</td>
</tr>
<tr>
<td>Valid week string</td>
<td><em>YYYY</em><code>-W</code><em>WW</em></td>
<td><code>2013-W46</code></td>
</tr>
<tr>
<td>Four or more ASCII digits</td>
<td><em>YYYY</em></td>
<td><code>2013</code>, <code>0001</code></td>
</tr>
<tr>
<td>Valid duration string</td>
<td>
<code>P</code><em>d</em><code>D</code><code>T</code><em>h</em
><code>H</code><em>m</em><code>M</code><em>s</em><code>S</code
><br /><code>P</code><em>d</em><code>D</code><code>T</code><em>h</em
><code>H</code><em>m</em><code>M</code><em>s</em><code>.</code>X<code
>S</code
><br /><code>P</code><em>d</em><code>D</code><code>T</code><em>h</em
><code>H</code><em>m</em><code>M</code><em>s</em><code>.</code>XX<code
>S</code
><br /><code>P</code><em>d</em><code>D</code><code>T</code><em>h</em
><code>H</code><em>m</em><code>M</code><em>s</em><code>.</code>XXX<code
>S</code
><br /><code>P</code><code>T</code><em>h</em><code>H</code><em>m</em
><code>M</code><em>s</em><code>S</code><br /><code>P</code><code>T</code
><em>h</em><code>H</code><em>m</em><code>M</code><em>s</em
><code>.</code>X<code>S</code><br /><code>P</code><code>T</code
><em>h</em><code>H</code><em>m</em><code>M</code><em>s</em
><code>.</code>XX<code>S</code><br /><code>P</code><code>T</code
><em>h</em><code>H</code><em>m</em><code>M</code><em>s</em
><code>.</code>XXX<code>S</code><br /><em>w</em><code>w </code><em>d</em
><code>d </code><em>h</em><code>h </code><em>m</em><code>m </code
><em>s</em><code>s</code>
</td>
<td>
<code
>P12DT7H12M13S<br />P12DT7H12M13.3S<br />P12DT7H12M13.45S<br />P12DT7H12M13.455S<br />PT7H12M13S<br />PT7H12M13.2S<br />PT7H12M13.56S<br />PT7H12M13.999S<br />7d
5h 24m 13s</code
>
</td>
</tr>
</tbody>
</table>

## 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

Expand Down
163 changes: 123 additions & 40 deletions files/en-us/web/html/element/time/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<table class="no-markdown">
<thead>
<tr>
<th scope="col">Description</th>
<th scope="col">Microsyntax</th>
<th scope="col">Examples</th>
</tr>
</thead>
<tbody>
<tr>
<td>Valid month string</td>
<td><code><em>YYYY</em>-<em>MM</em></code></td>
<td><code>2011-11</code>, <code>2013-05</code></td>
</tr>
<tr>
<td>Valid date string</td>
<td><code><em>YYYY</em>-<em>MM</em>-<em>DD</em></code></td>
<td><code>1887-12-01</code></td>
</tr>
<tr>
<td>Valid yearless date string</td>
<td><code><em>MM</em>-<em>DD</em></code></td>
<td><code>11-12</code></td>
</tr>
<tr>
<td>Valid time string</td>
<td>
<code><em>HH</em>:<em>MM</em></code><br />
<code><em>HH</em>:<em>MM</em>:<em>SS</em></code><br />
<code><em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code>
</td>
<td>
<code>23:59</code><br />
<code>12:15:47</code><br />
<code>12:15:52.998</code>
</td>
</tr>
<tr>
<td>Valid local date and time string</td>
<td>
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em><em>HH</em>:<em>MM</em></code><br />
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em> <em>HH</em>:<em>MM</em>:<em>SS</em></code><br />
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em> <em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code><br />
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em></code><br />
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em>:<em>SS</em></code><br />
<code><em>YYYY</em>-<em>MM</em>-<em>DD</em>T<em>HH</em>:<em>MM</em>:<em>SS</em>.<em>mmm</em></code>
</td>
<td>
<code>2013-12-25 11:12</code><br />
<code>1972-07-25 13:43:07</code><br />
<code>1941-03-15 07:06:23.678</code><br />
<code>2013-12-25T11:12</code><br />
<code>1972-07-25T13:43:07</code><br />
<code>1941-03-15T07:06:23.678</code>
</td>
</tr>
<tr>
<td>Valid time-zone offset string</td>
<td>
<code>Z</code><br />
<code>+<em>HHMM</em></code><br />
<code>+<em>HH</em>:<em>MM</em></code><br />
<code>-<em>HHMM</em></code><br />
<code>-<em>HH</em>:<em>MM</em></code>
</td>
<td>
<code>Z</code><br />
<code>+0200</code><br />
<code>+04:30</code><br />
<code>-0300</code><br />
<code>-08:00</code>
</td>
</tr>
<tr>
<td>Valid global date and time string</td>
<td style="max-width:12em">
Any combination of a valid local date and time string followed by a
valid time-zone offset string
</td>
<td>
<code>2013-12-25 11:12+0200</code><br />
<code>1972-07-25 13:43:07+04:30</code><br />
<code>1941-03-15 07:06:23.678Z</code><br />
<code>2013-12-25T11:12-08:00</code>
</td>
</tr>
<tr>
<td>Valid week string</td>
<td><code><em>YYYY</em>-W<em>WW</em></code></td>
<td><code>2013-W46</code></td>
</tr>
<tr>
<td>Four or more ASCII digits</td>
<td><code><em>YYYY</em></code></td>
<td><code>2013</code>, <code>0001</code></td>
</tr>
<tr>
<td>Valid duration string</td>
<td>
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>S</code><br />
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>X</em>S<br />
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>XX</em>S</code><br />
<code>P<em>d</em>DT<em>h</em>H<em>m</em>M<em>s</em>.<em>XXX</em>S</code><br />
<code>PT<em>h</em>H<em>m</em>M<em>s</em>S</code><br />
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>X</em>S</code><br />
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>XX</em>S</code><br />
<code>PT<em>h</em>H<em>m</em>M<em>s</em>.<em>XXX</em>S</code><br />
<code><em>w</em>w <em>d</em>d <em>h</em>h <em>m</em>m <em>s</em>s</code>
</td>
<td>
<code>P12DT7H12M13S</code><br />
<code>P12DT7H12M13.3S</code><br />
<code>P12DT7H12M13.45S</code><br />
<code>P12DT7H12M13.455S</code><br />
<code>PT7H12M13S</code><br />
<code>PT7H12M13.2S</code><br />
<code>PT7H12M13.56S</code><br />
<code>PT7H12M13.999S</code><br />
<code>7d 5h 24m 13s</code>
</td>
</tr>
</tbody>
</table>

## Examples

Expand Down

0 comments on commit 835c199

Please sign in to comment.