codescracker


html

HTML TIME Tag



« Previous Tutorial Next Tutorial »


The TIME tag is newly introduced in HTML5 and is used to define the date and/or time on a Web page.

The TIME tag displays the time in 24-hour clock format and the date in the proleptic Gregorian calendar format.

The TIME tag provides the datetime attribute, which is used to specify the valid date and time.

Attributes of TIME Tag

The following table describes the attributes of the TIME tag :

Attribute Description
datetime Specifies the date and/or time
pubdate Specifies the publishing date and time of a document

Example of TIME Tag

Following is an example of using the TIME tag :

<P>This example is written on <TIME datetime="2009-11-10">Friday</TIME>.</P>

In addition to the datetime attribute, the TIME tag also contains the pubdate attribute. This attribute is more useful when the TIME tag is defined inside the ARTICLE tag.

The pubdate attribute indicates that the date and time specified in the TIME tag is the publication date of the article defined in the nearest ancestor ARTICLE tag.


« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test