For the complete documentation index, see llms.txt. This page is also available as Markdown.

Date and Time

The datetime, date, and time types.

Internet Object has three temporal types, each with its own literal value:

Type
Literal
Captures

date

d'2024-03-20'

calendar date

time

t'14:30:45'

time of day

datetime

dt'2024-03-20T14:30:45Z'

date + time (ISO 8601)

For the literal value syntax in detail, see Date and Time.

created: datetime, birthday: date, opensAt: time
---
~ dt'2024-03-20T14:30:00Z', d'1990-05-01', t'09:00:00'   #

TypeDef

These types share one TypeDef. A MemberDef accepts only the options below.

Option
Type
Description

type

string

datetime, date, or time. First positional value.

default

datetime

Value used when the member is omitted.

choices

array

Restricts the value to a fixed set.

min

datetime

Earliest allowed value (inclusive).

max

datetime

Latest allowed value (inclusive).

optional

bool

If true, the member may be omitted. Shorthand: ? suffix.

null

bool

If true, the member may be null. Shorthand: * suffix.

Constraints

min / max

Optional, nullable & defaults

Input
Result

valid temporal literal

the value

out of min/max

invalid-range error

N, nullable (*)

null

N, not nullable

null-not-allowed error

omitted, optional (?)

absent

omitted, required

value-required error

Implementation status (beta)

  • datetime currently drops the seconds component on parse (dt'…T14:30:45Z' is read as …14:30:00). Under review.

  • Keyed null: is not yet honored — use the * suffix.

See Also

Last updated

Was this helpful?