package timedesc

  1. Overview
  2. Docs

Module Timedesc.ZonelessSource

Sourcetype zoneless
Sourcetype error_when_zoned = [
  1. | `Does_not_exist
  2. | `Invalid_tz_info of string option * Span.t
]
Sourceexception Error_when_zoned_exn of error_when_zoned

Constructors

Sourceval make : Date.t -> Time.t -> zoneless

Accessors

Sourceval date : zoneless -> Date.t
Sourceval time : zoneless -> Time.t

Comparison

Sourceval equal : zoneless -> zoneless -> bool

Conversion

Sourceval to_timestamp_local : zoneless -> timestamp

This yields a "local timestamp" - we pretend we are in the UTC time zone, and calculate seconds since unix epoch

Sourceval to_zoned : ?tz:Time_zone.t -> zoneless -> (t, error_when_zoned) result

tz defaults to result of Utils.get_local_tz_for_arg

Sourceval to_zoned_exn : ?tz:Time_zone.t -> zoneless -> t
Sourceval to_zoned_unambiguous : ?tz:Time_zone.t -> offset_from_utc:Span.t -> zoneless -> (t, error_when_zoned) result
Sourceval to_zoned_unambiguous_exn : ?tz:Time_zone.t -> offset_from_utc:Span.t -> zoneless -> t
Sourceval of_zoned : t -> zoneless

Parsing

Sourceval of_iso8601 : string -> (zoneless, string) result

Parses a subset of ISO8601, up to 9 fractional digits for second (nanosecond precision).

If more than 9 fractional digits are provided, then only the first 9 digits are used, i.e. no rounding.

Sourceval of_iso8601_exn : string -> zoneless
Sourceval maybe_zoneless_of_iso8601 : string -> ([ `Zoned of t | `Zoneless of zoneless ], string) result
Sourceval maybe_zoneless_of_iso8601_exn : string -> [ `Zoned of t | `Zoneless of zoneless ]
OCaml

Innovation. Community. Security.