Lossless FEEL time value.
This type exists because neither Elixir's Time nor Erlang's :calendar
represents the complete FEEL time domain. Elixir time is limited to
microsecond precision and carries no zone identity. OTP's RFC 3339 helpers
can convert conventional numeric offsets to an instant, but do not represent
floating times, IANA zone names, or second-precision offsets as values.
FEEL requires all of those distinctions. In particular, a floating time is
not interchangeable with a zoned time, and an IANA zone name must be retained
even when an offset can be resolved for comparison. Seconds are therefore
stored as Decimal for up to nanosecond precision, while zone explicitly
records floating, numeric-offset, or named-zone identity.
Named-zone validation uses the IANA database through tz; the value
representation remains independent of that resolver.
Summary
Functions
Adds seconds and wraps the result within one day.
Compares compatible FEEL times, returning :unordered for incompatible zones.
Calculates left - right when the time values are comparable.
Converts an Elixir time into a floating FEEL time.
Returns seconds since local midnight without applying a zone offset.
Creates a validated FEEL time.
Parses a FEEL time, preserving fractional seconds and zone identity.
Serializes a FEEL time.
Types
Functions
Adds seconds and wraps the result within one day.
Boxic.FEEL.Time.add_seconds(time, Decimal.new("0.5"))
Compares compatible FEEL times, returning :unordered for incompatible zones.
Boxic.FEEL.Time.compare(left, right)
@spec difference(t(), t()) :: {:ok, Boxic.FEEL.Duration.t()} | :error
Calculates left - right when the time values are comparable.
Boxic.FEEL.Time.difference(left, right)
Converts an Elixir time into a floating FEEL time.
Boxic.FEEL.Time.from_elixir(~T[12:30:15])
Returns seconds since local midnight without applying a zone offset.
Boxic.FEEL.Time.local_seconds(time)
Creates a validated FEEL time.
Boxic.FEEL.Time.new(12, 30, Decimal.new("15.5"), {:offset, 0})
Parses a FEEL time, preserving fractional seconds and zone identity.
Boxic.FEEL.Time.parse("12:30:15.5Z")
Serializes a FEEL time.
Boxic.FEEL.Time.to_string(time)