The DateTime type represents dates and times in ISO 8601 format.
Type URL | https://rustybeam.net/schema/DateTime |
---|---|
Base Type | datetime |
Default Pattern | ^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:\.\d{3})?(?:Z|[+-]\d{2}:\d{2})?)?$ |
Constraints | {"format": "ISO 8601"} |
The validation pattern accepts ISO 8601 dates and datetimes:
2024-07-18
2024-07-18T14:30:00
2024-07-18T14:30:00.123
2024-07-18T14:30:00Z
2024-07-18T14:30:00+02:00
2024-07-18T14:30:00-05:00
<tr itemscope itemtype="https://rustybeam.net/schema/Property">
<td><span itemprop="name">createdAt</span></td>
<td><span itemprop="type">DateTime</span></td>
<td><span itemprop="cardinality">1</span></td>
<td><span itemprop="description">When the record was created</span></td>
</tr>
<time itemprop="createdAt" datetime="2024-07-18T14:30:00Z">July 18, 2024</time>
Note: When using DateTime in HTML, it's recommended to use the <time>
element with the datetime
attribute for machine-readable values.