Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML time datetime Attribute

HTML

HTML time Tag Reference HTML

Example

A time element specifying a date:

<

p

I am

<

time

datetime

=

"

2008-02-14

"

Valentine's Day

time

have a date.

p

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The datetime attribute does not render any special effect in any browser.


Definition and Usage

the datetime property specifies a date or time. This property is used when no date or time is specified in the content of the element.


Differences between HTML 4.01 and HTML5


Syntax

Attribute values

Value Description
YYYY-MM-DDThh:mm:ssTZD

Date or time. The components are explained below:

  • YYYY - Year (e.g. 2011)
  • MM - Month (e.g. 01 for January)
  • DD - Day (e.g. 08)
  • T - Required separator if the time is specified
  • hh - Hour (e.g. 22 for 10.00pm)
  • mm - Minute (e.g. 55)
  • ss - Second (e.g. 03)
  • TZD - Time zone designator (Z stands for Zulu, also known as Greenwich Mean Time)
  • |

    HTML time Tag Reference HTML