Skip to content

SqueakQL dates and times

CURRENT_DATE means the start of the current UTC date. CURRENT_TIMESTAMP means the first search request’s timestamp, retained across its cursor pages. The web view captures a new timestamp on each navigation. They are Hamstik query values, not PostgreSQL session functions.

created_at >= CURRENT_DATE
updated_at < CURRENT_TIMESTAMP

Use a positive interval with temporal arithmetic:

updated_at >= CURRENT_TIMESTAMP - INTERVAL '7 days'
created_at >= CURRENT_DATE - INTERVAL '30 days'

Supported units are minutes, hours, days, weeks, and months. The singular forms also work, and units are case-insensitive. The amount must be an integer from 1 to 3,650. Zero, negative or fractional amounts, mixed units, and other units are rejected. Use + to move forward and - to move back. Only CURRENT_DATE and CURRENT_TIMESTAMP support interval arithmetic.

Minutes, hours, days and weeks use fixed elapsed UTC time. Months use calendar arithmetic and clamp to the last day of the destination month: January 31 plus one month becomes February 28, or February 29 in a leap year. A month is not defined as 30 days.

Dates use YYYY-MM-DD and mean midnight UTC. Timestamps use YYYY-MM-DDTHH:mm:ss[.fraction]Z or an explicit offset such as +02:00; up to six fractional digits are supported. Offsets are normalized to UTC. Timezone-free timestamps, locale date formats, impossible calendar dates, leap seconds, and year zero are rejected.

Date literals may be used in ranges:

created_at BETWEEN '2026-09-01' AND '2026-09-08'

BETWEEN includes both endpoints; the final date here means midnight at the start of September 8. To include that entire UTC day, use an exclusive next-day bound:

created_at >= '2026-09-01' AND created_at < '2026-09-09'

due_date is a nullable due timestamp; due_date < CURRENT_DATE finds due times before today’s UTC midnight.