Latest web development tutorials

HTML <time> tag

Examples

How to define the time and date:

<P> We in the morning <time> 9:00 </ time> opened. </ P> <P> I <time datetime = "2016-02-14"> Valentine's Day </ time> have an appointment. </ P>

try it"

Browser Support

Figures in the table represent the first browser to support the property version number.

element
<Time> 6.0 9.0 4.0 5.0 11.1

Tag definitions and instructions

<Time> tag defines calendar time (24-hour) or the date, time and time zone offset it is optional.

This element can be machine-readable way to encode the date and time, such as, for example, the user agent to the birthday reminder or scheduled event to add to the user schedule, the search engine can generate more intelligent search results.


Differences between HTML 4.01 and HTML5

<Time> tag is new in HTML5 tags.


Attributes

New: HTML5 new property.

属性 描述
datetime New datetime 规定日期/时间。另一种方式,则是由元素的内容给定日期/时间。

Global Properties

<time> tag supports HTML global properties .


Event Properties

<time> tag supports HTML event properties .