0Pricing
HTML Academy · Lesson

Time address and mark

Mark up dates, contact info, and highlighted text semantically.

The time Element

The <time> element marks up dates and times in a machine-readable format:

<p>Published on <time datetime="2025-01-15">January 15, 2025</time>.</p>
<p>The meeting is at <time datetime="14:30">2:30 PM</time>.</p>
<p>The event runs from
  <time datetime="2025-01-15">Jan 15</time> to
  <time datetime="2025-01-20">Jan 20</time>.
</p>

datetime Attribute Formats

The datetime attribute must be a valid date/time string:

<time datetime="2025-01-15">January 15</time>        <!-- date -->
<time datetime="14:30">2:30 PM</time>               <!-- time -->
<time datetime="2025-01-15T14:30">Meeting time</time> <!-- date+time -->
<time datetime="2025-W03">Week 3, 2025</time>        <!-- week -->
<time datetime="2025-01">January 2025</time>         <!-- year-month -->
<time datetime="P3D">3 days</time>                  <!-- duration -->

All lessons in this course

  1. header nav main and footer
  2. The article Element Self-Contained Content
  3. The section Element vs div
  4. Time address and mark
← Back to HTML Academy