0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
A machine-readable date, time or duration on time, del and ins, while the visible text stays human-friendly. VB's data-format-date formats it for you.
Overview
The datetimeattribute holds a machine-readable date, time or duration, while the element's text says the same thing for people. Scripts, search engines, feed readers and VB components read the attribute; readers see the text.
Applies to:
<time> — dates, times, time-zone offsets, weeks, years and durations.
<del> and <ins> — when the change was made: a date, optionally with a time.
Native and formatted dates
1234
<p>Published <timedatetime="2026-09-22">22 September 2026</time>.</p><!-- VB rewrites the text in the reader's locale --><p>Updated <timedatetime="2026-11-01T09:00:00Z"data-format-date="relative">1 November 2026</time>.</p>
Values
On <time> the value must be one of these forms. They are a subset of ISO 8601.
Form
Example
Meaning
Year
2026
The year 2026
Month
2026-09
September 2026
Date
2026-09-22
22 September 2026
Yearless date
09-22
22 September, any year
Week
2026-W39
Week 39 of 2026
Time
14:30, 14:30:15.5
A time of day, no date
Local date and time
2026-09-22T14:30
No time zone
Global date and time
2026-09-22T14:30Z, 2026-09-22T14:30-05:00
A moment in time, with UTC or an offset
Time-zone offset
+05:30
An offset on its own
Duration
PT1H45M, P3D
1 hour 45 minutes; 3 days
Absent (the default)
The element's text is parsed instead
On <del> and <ins> only a date, optionally followed by a time, is allowed. A space may replace the T. Durations use P (period) and T before time parts; ISO 8601 durations with years or months (P1Y) are not valid in HTML.
Examples
Dates and times
Dates, times and durations
1234
<p>Event starts <timedatetime="2026-06-20T19:00-05:00">7 PM Central, 20 June</time>.</p><p>Doors open at <timedatetime="18:30">6:30 PM</time>.</p><p>Runtime <timedatetime="PT1H45M">1 hour 45 minutes</time>.</p><p>Shipping takes <timedatetime="P3D">3 days</time>.</p>
If the text is already a valid value, datetime can be left off: <time>2026-09-22</time>. Human-friendly text almost never is.
Article dates
Published and updated
12345678
<article><h2>New dashboard</h2><p>Published <timedatetime="2026-09-22T10:00Z">22 September 2026</time> by Jane Smith</p><p>…</p><footer><p>Updated <timedatetime="2026-10-05T16:45Z">5 October 2026</time></p></footer></article>
data-format-date on a <time datetime> rewrites the text with Intl.DateTimeFormat in the reader's locale (short, medium, long, full) or as relative time (relative, refreshed as time passes). The tooltip is built in: in absolute mode the original text moves to title; in relative mode title holds the exact date and time. An authored title is kept (src/utils/format-date-init.js). Date-only values are formatted in UTC so they never shift a day.
data-format-date only handles values JavaScript's Date can parse: years, months, dates and date-times. Durations, time-only, week and offset values are left as written. Do not use it on yearless dates (09-22): some engines parse them as a date in 2001.
Styling. Every <time> gets font-variant-numeric: tabular-nums so digits line up in tables and lists (src/native-elements/inline-semantics/styles.css).
<del> / <ins> accept VB's data-author, data-reason and data-announce annotations; see the <ins> page.
Accessibility
Screen readers read the visible text, not datetime. Make the text clear on its own: "22 September 2026", not "22/09".
Relative times ("last week") should have the absolute date available. data-format-date="relative" puts it in title, but title is not reliably exposed to touch or keyboard users, so show the absolute date nearby where it matters.
Gotchas
Browsers do not show datetime and do not warn about invalid values. Run an HTML validator.
A date-time without Z or an offset is a local time with no zone. Anyone formatting it has to guess the zone; add one for real moments in time.
On <del> and <ins>, datetime is for tools and change tracking; nothing displays it.