This module is only used in the implementation of ofday.ml, and isn't exposed as
a submodule of Core_kernel
.
val parse : Core_kernel__.Import.string ‑> f:(Core_kernel__.Import.string ‑> hr:Core_kernel__.Import.int ‑> min:Core_kernel__.Import.int ‑> sec:Core_kernel__.Import.int ‑> subsec_pos:Core_kernel__.Import.int ‑> subsec_len:Core_kernel__.Import.int ‑> 'a) ‑> 'a
Parses a given time-of-day string. If the string is invalid, raises. If the string is
valid, calls f
with the string, the parsed numbers of hours, minutes, and seconds,
and the position and length of the substring representing subseconds, which can be
parsed with the appropriate precision for a given representation.
The substring String.sub string ~pos:subsec_pos ~len:subsec_len
will be either the
empty string (representing zero) or a decimal point ('.') and one or more digits
and/or underscores (representing a fractional number of seconds in decimal notation).
Illegal hours, minutes, or seconds values are rejected by parse
, as are times with
the hour of 24 and non-zero minutes or seconds. The time "24:00:00" itself is
accepted. If seconds is 60 (a leap second), the client will be passed ~subsec_len:0
regardless of the subsecond part.
val invalid_string : Core_kernel__.Import.string ‑> reason:Core_kernel__.Import.string ‑> _
Raises ofday-parsing errors for the given string, annotated with the given reason.
Useful inside the ~f
argument to parse
in order to generate error messages that
are consistent with what parse
raises.
val am_suffixes : Core_kernel__.Import.string Core_kernel__.Import.list Core_kernel.Lazy.t
Allowed AM/PM suffixes; useful for testing.
val pm_suffixes : Core_kernel__.Import.string Core_kernel__.Import.list Core_kernel.Lazy.t