Skip to content

Temporal Types Cookbook

This document provides examples for constructing XTDB temporal types in CLojure, for use in XTQL queries and transactions.

See the Temporal Types documentation for more information.


#time/date "2023-03-15"

Timestamp [Without Time Zone]

#time/date-time "2023-03-15T12:00:00"

Timestamp [With Time Zone]

#time/zoned-date-time "2023-03-15T12:00:00+01:00"

Time [Without Time Zone]

#time/time "14:30:00"

Year-Month Interval

A Year-Month Interval specified in ISO8601 format.

#xt/interval-ym "P1Y2M"

Month-Day-Nanosecond Interval

A Day-Time Interval specified in ISO8601 format.

#xt/interval-mdn ["P1D" "PT2H30M10.111111S"]


A Duration specified in ISO8601 format

#time/duration "P20H3M11.1S"


A Period specified with two dates.

(period #time/date "1998-01-05" #time/date "1998-01-12")