Instant
One moment for everyone, written 2026-10-25T09:30:00Z.
Time and calendar; ordered; since Jadpo 0.1.0.
Make one
text.parse(raw, as: Instant) reads one from its text; 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.
Text, JSON and storage
text.from writes its canonical text, the one form text.parse reads back. JSON sends its canonical text as a string.
| Text | JSON |
|---|---|
2026-03-29T00:30:00Z |
"2026-03-29T00:30:00Z" |
2026-10-25T09:30:00.250Z |
"2026-10-25T09:30:00.250Z" |
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.
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.
Like every standard type, it also has the contract's own operations: text.parse, text.from, text.format, json.read, json.write and ==. It is ordered, so < and sorting take it. Every standard type meets one contract says how they work.
Markdown for agents: /docs/types/type-instant.md.Built from Jadpo main at e00e61f.