HTML CSS examples for HTML Tag:time
time element marks Times and Dates.
You use the time element to represent a time of day or a date.
The time Element summary
Item | Value |
---|---|
Element | time |
Local Attributes | datetime, pubdate |
Tag Style | Start and end tag |
New in HTML5 | Yes |
Changes in HTML5 | N/A |
Style Convention | None |
If the Boolean pubdate attribute is set, the time element tells the publication date of the entire HTML document or the nearest article element.
The datetime attribute specifies the date or time in a format specified by RFC3339.
The following table shows the attributes that are specific to the <time> tag.
Attribute | Value | Description |
---|---|---|
datetime | datetime | time or date that the element represents. |
The following code shows how to use the time Element
<!DOCTYPE html> <html> <head> <title>Example</title> </head> <body> Right now is <!-- www .jav a2s .c o m--> <time datetime="15:00">3 o'clock</time> on <time datetime="2019-12-7">December 7th</time> . </body> </html>