![]() |
Definition and UsageThe The Browser SupportThe numbers in the table specify the first browser version that fully supports the element. Attributes
Global AttributesThe Event AttributesThe |
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The time element</h1>
<p>Open from <time>10:00</time> to <time>21:00</time> every weekday.</p>
<p>I have a date on <time datetime="2008-02-14 20:00">Valentines day</time>.</p>
<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>
</body>
</html>
It is A time element with a machine-readable datetime attribute.
Definition and Usage.
The datetime attribute represent a machine-readable format of a <time> element.
<time datetime="YYYY-MM-DDThh:mm:ssTZD">
Value | Description |
---|---|
YYYY-MM-DDThh:mm:ssTZD or PTDHMS |
The date or time being specified. Explanation of components:
|
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<h1>The time datetime attribute</h1>
<p>I have a date on <time datetime="2017-02-14 20:00">Valentines day</time>.</p>
<p><b>Note:</b> The time element does not render as anything special in any of the major browsers.</p>
</body>
</html>
Examples of valid datetime values.
Example:
HTML
Dates:
<time datetime="1914"> <!-- means the year 1914 -->
<time datetime="1914-12"> <!-- means December 1914 -->
<time datetime="1914-12-20"> <!-- means 20 December 1914 -->
<time datetime="12-20"> <!-- means 20 December any year -->
<time datetime="1914-W15"> <!-- means week 15 of year 1914 -->
Date and Times:
<time datetime="1914-12-20T08:00"> <!-- means 20 December 1914 at 8am -->
<time datetime="1914-12-20 08:00"> <!-- also means 20 December 1914 at 8am -->
<time datetime="1914-12-20 08:30:45"> <!-- with minutes and seconds -->
<time datetime="1914-12-20 08:30:45.687"> <!-- with minutes, seconds, and milliseconds -->
Times:
<time datetime="08:00"> <!-- means 8am -->
<time datetime="08:00-03:00"> <!-- means 8am in Rio de Janeiro (UTC-3 hours) -->
<time datetime="08:00+03:00"> <!-- means 8am in Madagascar (UTC+3 hours) -->
Durations:
<time datetime="P2D"> <!-- means a duration of 2 days -->
<time datetime="PT15H10M"> <!-- means a duration of 15 hours and 10 minutes -->
html time |
How to create HTML <time> Tag | HTML Tag |
How to add HTML <time> datetime Attribute | HTML Tag |
How to add various date and time format in HTML | HTML Tag |
Read Full: | HTML Tag |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Tag |
Uploaded: | 3 weeks ago |
Uploaded by: | Admin |
Views: | 35 |
Reffered: https://www.w3schools.com/tags/tag_time.asp