You can search for identifiers within the package.
in-package search v0.2.0
Source file time_ns_unix_intf.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361open!CoremoduleTime=Time_float_unixmoduletypeOption=sigincludeImmediate_option.S_int63includeIdentifiablewithtypet:=tendmoduletypeSpan=sigincludemoduletypeofstructincludeTime_ns.Spanend[@ocaml.remove_aliases]withmodulePrivate:=Time_ns.Span.PrivateendmoduletypeOfday=sigincludemoduletypeofstructincludeTime_ns.Ofdayendvalarg_type:tCore.Command.Arg_type.tvalnow:zone:Time.Zone.t->tvalto_ofday:t->Time.Ofday.t[@@deprecated"[since 2019-01] use [to_ofday_float_round_nearest] or \
[to_ofday_float_round_nearest_microsecond]"]valof_ofday:Time.Ofday.t->t[@@deprecated"[since 2019-01] use [of_ofday_float_round_nearest] or \
[of_ofday_float_round_nearest_microsecond]"]valto_ofday_float_round_nearest:t->Time.Ofday.tvalto_ofday_float_round_nearest_microsecond:t->Time.Ofday.tvalof_ofday_float_round_nearest:Time.Ofday.t->tvalof_ofday_float_round_nearest_microsecond:Time.Ofday.t->tmoduleZoned:sig(** Sexps look like "(12:01 nyc)"
Two [t]'s may or may not correspond to the same times depending on which date
they're evaluated. *)typet[@@derivingbin_io,sexp,hash]includePretty_printer.Swithtypet:=t(** Strings look like "12:01 nyc" *)includeStringablewithtypet:=tvalarg_type:tCore.Command.Arg_type.tvalcreate:Time_ns.Ofday.t->Time.Zone.t->tvalcreate_local:Time_ns.Ofday.t->tvalofday:t->Time_ns.Ofday.tvalzone:t->Time.Zone.tvalto_time_ns:t->Date.t->Time_ns.tmoduleWith_nonchronological_compare:sig(** It is possible to consistently compare [t]'s, but due to the complexities of
time zones and daylight savings, the resulting ordering is not chronological.
That is, [compare t1 t2 > 0] does not imply [t2] occurs after [t1] every day,
or any day. *)typenonrect=t[@@derivingbin_io,sexp,compare,equal,hash]endmoduleStable:sigmoduleV1:sigtypenonrect=t[@@derivinghash]includeStable_without_comparator_with_witnesswithtypet:=tendendendmoduleOption:sigincludeOptionwithtypevalue:=tincludeQuickcheck.Swithtypet:=tincludeDiffable.S_atomicwithtypet:=tmoduleStable:sigmoduleV1:sigincludeStable_int63able_with_witnesswithtypet=tincludeDiffable.S_atomicwithtypet:=tendend(** Returns [some] if the given span is a valid time since start of day, and [none]
otherwise. *)valof_span_since_start_of_day:Time_ns.Span.t->tendend(** An absolute point in time, more efficient and precise than the [float]-based {!Time},
but representing a narrower range of times.
This module represents absolute times with nanosecond precision, approximately between
the years 1823 and 2116 CE.
Some reasons you might prefer [Time_ns.t] over float-based [Time.t]:
- It has superior performance.
- It uses [int]s rather than [float]s internally, which makes certain things easier to
reason about, since [int]s respect a bunch of arithmetic identities that [float]s
don't, e.g., [x + (y + z) = (x + y) + z].
Some reasons you might prefer to use float-based [Time] instead of this module:
- Some libraries use [Time.t] values, often for historical reasons, so it may be
necessary to use [Time.t] with them.
- [Time_ns] silently ignores overflow.
Neither {!Time_ns_unix} nor {!Time_float_unix} are available in JavaScript, but both
{!Core.Time_ns} and {!Core.Time} are.
See {!Core.Time_ns} for additional low level documentation. *)moduletypeTime_ns_unix=sigincludemoduletypeofstructincludeTime_nsend[@ocaml.remove_aliases]withmoduleSpan:=Time_ns.SpanwithmoduleOfday:=Time_ns.OfdaywithmoduleStable:=Time_ns.StablewithmoduleOption:=Time_ns.OptionmoduleSpan:Spanvalarg_type:tCore.Command.Arg_type.t(** [Option.t] is like [t option], except that the value is immediate. This module
should mainly be used to avoid allocations. *)moduleOption:sigincludeOptionwithtypet=Time_ns.Option.twithtypevalue:=tincludeQuickcheck.Swithtypet:=tincludeDiffable.S_atomicwithtypet:=tmoduleStable:sigmoduleV1:sigincludeStable_int63able_with_witnesswithtypet=tincludeDiffable.S_atomicwithtypet:=tendendend(** See {!Time.Ofday}. *)moduleOfday:Ofday(** String conversions use the local timezone by default. Sexp conversions use
[get_sexp_zone ()] by default, which can be overridden by calling [set_sexp_zone].
These default time zones are used when writing a time, and when reading a time with
no explicit zone or UTC offset.
Sexps and strings display the date, ofday, and UTC offset of [t] relative to the
appropriate time zone. *)includeIdentifiablewithtypet:=tincludeDiffable.S_atomicwithtypet:=tincludesigtypet[@@derivingsexp_grammar]endwithtypet:=tmoduleZone:moduletypeofTime.Zonewithtypet=Time.Zone.t(** These functions are identical to those in [Time] and get/set the same variable. *)valget_sexp_zone:unit->Zone.tvalset_sexp_zone:Zone.t->unit(** [t_of_sexp_abs sexp] as [t_of_sexp], but demands that [sexp] indicate the timezone
the time is expressed in. *)valt_of_sexp_abs:Sexp.t->tvalsexp_of_t_abs:t->zone:Zone.t->Sexp.t(** Conversion functions that involved Ofday.Zoned.t, exactly analogous to the
conversion functions that involve Ofday.t *)valof_date_ofday_zoned:Date.t->Ofday.Zoned.t->tvalto_date_ofday_zoned:t->zone:Time.Zone.t->Date.t*Ofday.Zoned.tvalto_ofday_zoned:t->zone:Time.Zone.t->Ofday.Zoned.tvalto_string_fix_proto:[`Utc|`Local]->t->stringvalof_string_fix_proto:[`Utc|`Local]->string->t(** This is like [of_string] except that if the string doesn't specify the zone then it
raises rather than assume the local timezone. *)valof_string_abs:string->t(** [of_string_gen ~if_no_timezone s] attempts to parse [s] to a [t]. If [s] doesn't
supply a time zone [if_no_timezone] is consulted. *)valof_string_gen:if_no_timezone:[`Fail|`Local|`Use_this_oneofZone.t]->string->t(** [pause span] sleeps for [span] time. *)valpause:Span.t->unit(** [interruptible_pause span] sleeps for [span] time unless interrupted (e.g. by
delivery of a signal), in which case the remaining unslept portion of time is
returned. *)valinterruptible_pause:Span.t->[`Ok|`RemainingofSpan.t](** [pause_forever] sleeps indefinitely. *)valpause_forever:unit->never_returns(** [format t fmt] formats the given time according to fmt, which follows the formatting
rules given in 'man strftime'. The time is output in the given timezone. Here are
some commonly used control codes:
{v
%Y - year (4 digits)
%y - year (2 digits)
%m - month
%d - day
%H - hour
%M - minute
%S - second
v}
a common choice would be: %Y-%m-%d %H:%M:%S
Although %Z and %z are interpreted as format strings, neither are correct in the
current implementation. %Z always refers to the local machine timezone, and does not
correctly detect whether DST is active. The effective local timezone can be
controlled by setting the "TZ" environment variable before calling [format]. %z
behaves unreliably and should be avoided.
Not all strftime control codes are standard; the supported subset will depend on the
C libraries linked into a given executable.
*)valformat:t->string->zone:Zone.t->string(** [parse string ~fmt ~zone] parses [string], according to [fmt], which follows the
formatting rules given in 'man strptime'. The time is assumed to be in the given
timezone.
{v
%Y - year (4 digits)
%y - year (2 digits)
%m - month
%d - day
%H - hour
%M - minute
%S - second
v}
Raise if [allow_trailing_input] is false and [fmt] does not consume all of the
input. *)valparse:?allow_trailing_input:bool(** default = false *)->string->fmt:string->zone:Zone.t->tmoduleStable:sigmoduleV1:sigtypenonrect=t[@@derivingequal,hash]includeStable_int63able_with_witnesswithtypet:=tandtypecomparator_witness=comparator_witnessincludeComparable.Stable.V1.With_stable_witness.Swithtypecomparable:=twithtypecomparator_witness:=comparator_witnessincludeDiffable.S_atomicwithtypet:=tend(** Provides a sexp representation that is independent of the time zone of the machine
writing it. *)moduleAlternate_sexp:sigmoduleV1:sigincludeStable_without_comparatorwithtypet=tincludeDiffable.S_atomicwithtypet:=tendendmoduleOption:sigmoduleV1:sigincludeStable_int63able_with_witnesswithtypet=Option.tincludeDiffable.S_atomicwithtypet:=tendendmoduleSpan:sigmoduleV1:sigtypet=Span.t[@@derivinghash,equal,sexp_grammar]includeStable_int63able_with_witnesswithtypet:=tincludeDiffable.S_atomicwithtypet:=tendmoduleV2:sigtypet=Span.t[@@derivinghash,equal,sexp_grammar]typenonreccomparator_witness=Span.comparator_witnessincludeStable_int63able_with_witnesswithtypet:=twithtypecomparator_witness:=comparator_witnessincludeComparable.Stable.V1.With_stable_witness.Swithtypecomparable:=twithtypecomparator_witness:=comparator_witnessincludeStringable.Swithtypet:=tincludeDiffable.S_atomicwithtypet:=tendmoduleOption:sigmoduleV1:sigincludeStable_int63able_with_witnesswithtypet=Span.Option.tincludeDiffable.S_atomicwithtypet:=tendmoduleV2:sigincludeStable_int63able_with_witnesswithtypet=Span.Option.tincludeDiffable.S_atomicwithtypet:=tendendendmoduleOfday:sigmoduleV1:sigtypet=Ofday.t[@@derivingequal,hash,sexp_grammar]includeStable_int63able_with_witnesswithtypet:=Ofday.tandtypecomparator_witness=Time_ns.Stable.Ofday.V1.comparator_witnessincludeDiffable.S_atomicwithtypet:=tendmoduleZoned:sigmoduleV1:sigtypenonrect=Ofday.Zoned.t[@@derivinghash]includeStable_without_comparator_with_witnesswithtypet:=tendendmoduleOption:sigmoduleV1:sigincludeStable_int63able_with_witnesswithtypet=Ofday.Option.tincludeDiffable.S_atomicwithtypet:=tendendendmoduleZone=Timezone.Stableendend