better_duck_diesel::dsl::*.
Extracting parts
Timestamp -> BigInt unless noted:
year, month, day, hour, minute, second,
epoch(ts) (→Double, seconds since the Unix epoch),
date_trunc(part: Text, ts) (→Timestamp, truncate to 'day'/'month'/'hour'/…),
strftime(ts, format: Text) (→Text, format a timestamp).
Calendar parts and differences
Timestamp -> BigInt unless noted:
dayofweek(ts), isodow(ts), dayofyear(ts), weekofyear(ts), quarter(ts),
dayname(ts) (→Text), monthname(ts) (→Text), last_day(d: Date) (→Date),
datediff(part: Text, start, finish) (→BigInt, whole part units between two timestamps).
Building dates, times, and timestamps
make_timestamp takes microseconds since the Unix epoch, matching DuckDB’s native TIMESTAMP
resolution.See also
Type mapping
DATE / TIME / TIMESTAMP / TIMESTAMPTZ ↔ chrono.
Numeric & utility
Math on the
BigInt/Double results.Feature flags
chrono vs the native date path.DSL overview
The rest of the DSL.