<time> - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:time

Introduction

time element marks Times and Dates.

You use the time element to represent a time of day or a date.

The time Element summary

ItemValue
Element time
Local Attributesdatetime, pubdate
Tag Style Start and end tag
New in HTML5Yes
Changes in HTML5 N/A
Style ConventionNone

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.

Tag-Specific Attributes

The following table shows the attributes that are specific to the <time> tag.

Attribute ValueDescription
datetime datetime time or date that the element represents.

The following code shows how to use the time Element

Demo Code

ResultView the demo in separate window

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

Related Tutorials