Skip to main content

time_tz_bits

Function time_tz_bits 

Source
pub unsafe fn time_tz_bits(
    micros_since_midnight: i64,
    offset_seconds: i32,
) -> Option<u64>
Expand description

Packs a wall-clock time and UTC offset into DuckDB’s TIME WITH TIME ZONE bit representation.

offset_seconds is the offset from UTC in seconds.

Returns None unless micros_since_midnight is between 0 and MICROS_PER_DAY inclusive (00:00:00–24:00:00) and offset_seconds within ±TIME_TZ_MAX_OFFSET_SECONDS (±15:59:59). DuckDB packs the two fields without checking either, so a value outside those ranges would silently corrupt the other field.

§Safety

See date_from_days.