Home > Abakada: Back to Basics > Language References > HTML Elements > TIME Element
Represents a specific period in time. | HTML 5 |
HTML Syntax
<time datetime = machine-readable value> ... </time>
NOTE: Both start and end tags are required.
The <time
> element represents a specific period in time, which may be one of the following:
- A time on a 24-hour clock.
- A precise date in the Gregorian calendar (with optional time and timezone information).
- A valid time duration.
<time
> may include the datetime attribute to translate dates into machine-readable format, allowing for better search engine results or custom features such as reminders.
NOTE: This section of the workshop is under major reconstruction, in short, work in progress. So please bear with whatever inconvenience you may encounter; we hope to complete the job at the soonest possible time.
The <time>
element supports the following attributes, in addition to global attributes common to all HTML elements.
datetime | datetime | Represent a machine-readable format of the time element |
The following shows how the time element may be used.
/* A valid month string */
/* A valid date string */
/* A valid yearless date string */
/* A valid time string */
/* A valid local date and time string */
/* A valid time-zone offset string */
/* A valid global date and time string */
/* A valid week string */
/* A valid duration string */
In this example, the datetime attribute is used, wherein a specific time in the Pacific Standard Time timezone is specified:
Your next meeting is at <time datetime="2011-11-18T15:00-08:00">3pm</time>.
DATA