LanguageValues and typesStandard typesTime and calendar
Instant
On this page
One moment in time, the same everywhere in the world: 2026-10-25T09:30:00Z.
Use it for when something happened, such as when an order was placed. For a day on a calendar, use CalendarDate. For a time on someone's clock in a place, use ZonedTime. For a time with no place yet, use LocalDateTime.
Shape
One value, with no fields to fill in. As text it reads 2026-10-25T09:30:00.250Z.
Example
Instant("2026-10-25T09:30:00Z")text.parse(raw, as: Instant) reads one from text that comes from outside. Text that isn't one at all fails malformed, such as 2026-10-25, 2026-10-25T09:30:00 or yesterday.
This operation gives one: temporal.instant.
Good to know
- It is always in UTC, written with
Z. An offset such as+01:00is refused. clock.nowgives the current one. Adding aDurationgives another:clock.now + 14d.text.formatneeds a zone and a format, since a moment looks different in each place.==tells you whether two are the same, and<andlist.sort_bycompare and sort them.
In JSON
A string, in a request, a response or json.write:
"2026-03-29T00:30:00Z""2026-10-25T09:30:00.250Z"
Details
Text form, storage, how it is shown, and operations
Instant is in the group Time and calendar, and has been in Jadpo since 0.1.0.
Text form
text.from writes one standard text form, the same form text.parse reads back: 2026-03-29T00:30:00Z and 2026-10-25T09:30:00.250Z.
How it is stored
It is stored in one column named for the field, of type timestamptz(3). 2026-10-25T09:30:00.250Z is stored as '2026-10-25 09:30:00.250000+00'::timestamptz.
How it is shown to people
text.format(value, locale:) shows it to people in their locale. A call also gives zone: and format:.
With locale: Locale.en_gb, zone: Zone.europe_london and format: TimeFormat.date_time_medium:
| Value | Shown |
|---|---|
2026-03-29T00:30:00Z |
29 Mar 2026, 00:30:00 |
2026-10-25T09:30:00.250Z |
25 Oct 2026, 09:30:00 |
Operations
temporal.between(start: Instant, end: Instant) -> Duration: How long fromstarttoend:end - start.temporal.format_relative(value: T, now: Instant, zone: Zone?, locale: Locale) -> PresentationText:valueshown to a person inlocaleas how long ago it was fromnow: "just now", minutes, "Today at", "Yesterday at", the weekday, then the long date.temporal.in_zone(instant: Instant, zone: Zone) -> ZonedTime:instantas the local time inzone.temporal.instant(value: ZonedTime) -> Instant: The instant a local time is.temporal.occurrences(rule: RecurrenceRule, from: T, count: Int) -> List<ZonedTime>: The nextcountoccurrences ofruleat or afterfrom, in its zone (RFC 5545): fewer when the rule ends first;countis from 1 to 1000, so an unbounded rule is never expanded without a bound. From a date, the days they fall on,List<CalendarDate>, which a rule on dates gives; from anInstant, a timed rule's local times.temporal.open_at(hours: OpeningHours, at: Instant) -> Bool: Whetherhoursare open atat, by the clock in their zone.
It also takes text.parse, text.from, text.format, json.read, json.write and ==. How every standard type behaves says how they work.
Markdown for agents: /docs/types/type-instant.md.Built from Jadpo main at aee2e8f.