Module Temporal.Time

type t = time

A time of day (see time).

val of_ticks : ?tz_offset_seconds:int -> int64 -> t

A time from nanoseconds since midnight and an optional offset.

val to_ticks : t -> int64

Nanoseconds since midnight.

val tz_offset_seconds : t -> int option

The UTC offset in seconds, if any.

val of_hms_ns : ?tz_offset_seconds:int -> int -> int -> int -> int -> t option

A time from (hour, minute, second, nanosecond); None if out of range.

val to_hms_ns : t -> int * int * int * int

The (hour, minute, second, nanosecond) of a time.

val add : int64 -> t -> t

Add nanoseconds.

val sub : int64 -> t -> t

Subtract nanoseconds.

val compare : t -> t -> int

Compare two times by their ticks.

val equal : t -> t -> bool

Whether two times are equal (including offset).

val to_iso8601 : t -> string

Format as "HH:MM:SS.fff...+HH:MM".

val of_iso8601 : string -> t option

Parse "HH:MM:SS.fractionZ|+HH:MM"; None if invalid.

val to_string : t -> string

Alias for to_iso8601.