HTML <time> Tag
Description
Marks the text inside the <time>
HTML element as a date, time, or both. It can be specified directly inside the <time>
container, or it can be specified through the datetime attribute.
Properties
- Permitted Parents
- Any element that accepts phrasing content
- Content
- Inline and text, but no descendant
<time>
elements - Start/End Tags
- Start tag: required, End tag: required
Example
<p>Our business hours are <time>8:30</time> until <time>4:30</time></p>
<p>My holidays start on <time datetime="2018-12-25 00:00">Christmas day</time>.</p>
Attributes
Attribute | Definition |
---|---|
datetime | Gives the date/time being specified. Otherwise, the date/time is given by the element's contents |
Global Attributes
The <time>
tag also supports the Global Attributes in HTML5
Event Attributes
The <time>
tag also supports the Event Attributes in HTML5
Browser Support
Desktop | |||||
X | Yes | 62 | 22 | 49 | 7 |
Tablets / Mobile | |||||
![]() |
|||||
62 | 62 | 22 | 46 | 4 | X |
Last updated by CSSPortal on: 6th December 2019
HTML Tags
- a
- abbr
- address
- area
- article
- aside
- audio
- b
- base
- bdi
- bdo
- blockquote
- body
- br
- button
- canvas
- caption
- cite
- code
- col
- colgroup
- comment
- datalist
- dd
- del
- details
- dfn
- dialog
- div
- dl
- doctype
- dt
- em
- embed
- fieldset
- figcaption
- figure
- footer
- form
- h1
- h2
- h3
- h4
- h5
- h6
- head
- header
- hr
- html
- i
- iframe
- img
- input
- ins
- kbd
- keygen
- label
- legend
- li
- link
- map
- mark
- menu
- meta
- meter
- nav
- noscript
- object
- ol
- optgroup
- option
- output
- p
- param
- picture
- pre
- progress
- q
- rp
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- source
- span
- strong
- style
- sub
- summary
- sup
- table
- tbody
- td
- textarea
- tfoot
- th
- thead
- time
- title
- tr
- track
- u
- ul
- var
- video
- wbr