QuackDB.TimeWithTimeZone (quackdb v0.3.0)

Copy Markdown View Source

DuckDB TIME WITH TIME ZONE value.

DuckDB stores TIME WITH TIME ZONE as microseconds since midnight packed with a timezone offset in seconds. This struct exposes the decoded Time and UTC offset while preserving conversion to and from DuckDB's packed integer.

Summary

Functions

Decodes DuckDB's packed TIME WITH TIME ZONE integer.

Builds a TIME WITH TIME ZONE value from time and UTC offset seconds.

Encodes the value into DuckDB's packed TIME WITH TIME ZONE integer.

Formats the value as an ISO-like time with numeric UTC offset.

Types

t()

@type t() :: %QuackDB.TimeWithTimeZone{time: Time.t(), utc_offset: integer()}

Functions

from_bits(bits)

@spec from_bits(integer()) :: t()

Decodes DuckDB's packed TIME WITH TIME ZONE integer.

new(time, utc_offset)

@spec new(Time.t(), integer()) :: t()

Builds a TIME WITH TIME ZONE value from time and UTC offset seconds.

to_bits(time_with_time_zone)

@spec to_bits(t()) :: integer()

Encodes the value into DuckDB's packed TIME WITH TIME ZONE integer.

to_iso8601(value)

@spec to_iso8601(t()) :: String.t()

Formats the value as an ISO-like time with numeric UTC offset.