Content · Web Development · HTML

HTML Time and Duration Markup: Events, Deadlines, and Measurements

Time can provide a machine-readable date or clock time while showing a friendly label. Data works for other machine-readable values such as a duration count or product code.

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

Time can provide a machine-readable date or clock time while showing a friendly label. Data works for other machine-readable values such as a duration count or product code.

What You Need to Know


Do not confuse a duration measurement with a calendar date. Make units and time zones clear when relevant.

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


Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.

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

<p>Workshop: <time datetime="2026-11-03T15:30">November 3 at 3:30 PM</time>
</p>
<p>Duration: <data value="90">90 minutes</data>
</p>
<p>The visible labels are friendly to readers.</p>

Let’s Understand the Example


  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Time displays a date or time in readable words and can provide a machine-readable datetime value.
  • Data connects a readable label with a machine-readable value.
  • Datetime gives a date or time in a machine-readable form, separate from the friendly text shown to visitors.
  • Value is the value represented or submitted by a control or data element.

Look for the text “Workshop:” 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 “Workshop:”. 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. Add another event with an accurate date and a separate duration label.
  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


  • Writing a datetime value that disagrees with the visible event time.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • Time can provide a machine-readable date or clock time while showing a friendly label.
  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Do not confuse a duration measurement with a calendar date. Make units and time zones clear when relevant.
Share this resourceSend this page to someone who may find it useful.