Content · Web Development · HTML

HTML <time> Element and Datetime Formats

Time connects a friendly date or time label to a machine-readable datetime value. A reader sees natural text; tools can read the structured value.

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Time connects a friendly date or time label to a machine-readable datetime value. A reader sees natural text; tools can read the structured value.

What You Need to Know


Use an appropriate ISO-style format, and distinguish a local wall-clock time from a time with a zone offset. Do not include a fake Z if the time is not UTC.

The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.

Example: See It in Action


Here is a simple example to experiment with. Type it, save the file, and check what the browser displays.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<p>The event starts <time datetime="2026-11-07T14:00">Saturday at 2 pm</time>.</p>
<p>The machine value provides a precise date and time.</p>
<p>The visible words can stay friendly.</p>

Let’s Understand the Example


  • Time displays a date or time in readable words and can provide a machine-readable datetime value.
  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Datetime gives a date or time in a machine-readable form, separate from the friendly text shown to visitors.

Look for the text “The event starts” in the page. If the visible result surprises you, inspect the rendered elements to see what the browser actually built.

What Should You See?


The page should include “The event starts”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.

Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.

Try It Yourself


  1. Update the event time and make the visible and datetime values agree.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Putting an ambiguous value like next Friday in datetime instead of an actual date.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • Time connects a friendly date or time label to a machine-readable datetime value.
  • Time displays a date or time in readable words and can provide a machine-readable datetime value.
  • Use an appropriate ISO-style format, and distinguish a local wall-clock time from a time with a zone offset. Do not include a fake Z if the time is not UTC.
Share this resourceSend this page to someone who may find it useful.