When to use
Section titled “When to use”Wherever a date or time is shown: a creation date, a last update, an appointment time.
When not to use
Section titled “When not to use”- To pick a date: Use DatePicker or TimeField.
- For a countdown: Use CountdownTimer.
Anatomy
Section titled “Anatomy”- Created
- Last updated
- Time
import { DateTimeText, Provider } from '@bigbang/ui';
export default function Default() { return ( <Provider locale="en-GB"> <dl className="grid grid-cols-[auto_1fr] gap-x-xl gap-y-sm type-body-md"> <dt className="text-fg-subtle">Created</dt> <dd> <DateTimeText value="2026-10-08" /> </dd> <dt className="text-fg-subtle">Last updated</dt> <dd> <DateTimeText value="2026-10-08T14:30:00" dateStyle="long" /> </dd> <dt className="text-fg-subtle">Time</dt> <dd> <DateTimeText value="2026-10-08T11:30:00Z" format="time" timeZone="Europe/Istanbul" /> </dd> </dl> </Provider> );}<time>element: Itsdatetimeattribute holds the machine-readable value.- Text: The date, time or relative time formatted in the Provider language.
Behaviour
Section titled “Behaviour”- The format comes from
Intl.DateTimeFormatin the Provider language: “8 Eki 2026 14:30” in Turkish, “8 Oct 2026, 14:30” in English. - A plain ISO date (“2026-10-08”) is a local calendar day; it does not shift a day with the time zone.
- The
relativeformat usesIntl.RelativeTimeFormat(“yesterday”, “2 hours ago”) and refreshes every 30 seconds; changed text cross-fades. - With
now, relative time counts from it and does not refresh (for server rendering and tests).
Guidelines
Section titled “Guidelines”- Use exact time in records and tables, relative time in feeds.
- Use one format per list.
- If the zone matters, set
timeZoneand say it on the page.
Content
Section titled “Content”DateTimeText has no text of its own; month and day names come from Intl.
Related components
Section titled “Related components”- Timeline: Event times.
- DatePicker: Picking a date.