From 50d50f8d26711da2845fcfa116b1d735799c41ff Mon Sep 17 00:00:00 2001 From: darrenldl Date: Sat, 27 Apr 2024 11:25:07 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=208dd58?= =?UTF-8?q?abbf8aa37aded852dd07638ad6435b7aa10=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- timedesc/Timedesc/Span/For_human/index.html | 48 +++++++-------- timedesc/Timedesc/index.html | 65 +++++++++++++-------- 2 files changed, 64 insertions(+), 49 deletions(-) diff --git a/timedesc/Timedesc/Span/For_human/index.html b/timedesc/Timedesc/Span/For_human/index.html index 96cdfbe6..63fd28cb 100644 --- a/timedesc/Timedesc/Span/For_human/index.html +++ b/timedesc/Timedesc/Span/For_human/index.html @@ -31,34 +31,34 @@ ?seconds:float -> ?ns:int -> unit -> - t

Viewer

val view : t -> view

Pretty-printing

val pp : ?format:string -> unit -> Stdlib.Format.formatter -> t -> unit

Pretty-printing for span. * * Default format string:

{days-nz: days }{hours-nz:X hours }{mins-nz:X mins }{secs:X}{sec-frac:.X} secs

Format string specification:

        {{                      literal {
-        {days:unit}             number of days
-                                unit is the string used after the number to denote its unit
-        {days-nz:unit}          same as above, but does not display if number is zero
+  t

Viewer

val view : t -> view

Pretty-printing

val pp : ?format:string -> unit -> Stdlib.Format.formatter -> t -> unit

Pretty-printing for span. * * Default format string:

{days-nz: days }{hours-nz:X hours }{mins-nz:X mins }{secs:X}{sec-frac:.X} secs

Format string specification:

        {{                      Literal {
+        {days:unit}             Number of days
+                                Unit is the string used after the number to denote its unit
+        {days-nz:unit}          Same as above, but does not display if number is zero
 
-        {hours:cXunit}          number of hour, sub-day
-                                character 'c' before 'X' is used for padding
-                                (leave out character for no padding)
-                                unit is the string used after the number to denote its unit
-        {hours-nz:cXunit}       same as above, but does not display if number is zero
+        {hours:cXunit}          Number of hour, sub-day
+                                Character 'c' before 'X' is used for padding
+                                (leave out character for no padding, e.g. {hours:Xunit})
+                                Unit is the string used after the number to denote its unit
+        {hours-nz:cXunit}       Same as above, but does not display if number is zero
 
-        {mins:cXunit}           number of minutes, sub-hour
-                                character 'c' before 'X' is used for padding
-                                (leave out character for no padding)
-                                unit is the string used after the number to denote its unit
-        {mins-nz:cXunit}        same as above, but does not display if number is zero
+        {mins:cXunit}           Number of minutes, sub-hour
+                                Character 'c' before 'X' is used for padding
+                                (leave out character for no padding, e.g. {mins:Xunit})
+                                Unit is the string used after the number to denote its unit
+        {mins-nz:cXunit}        Same as above, but does not display if number is zero
 
-        {secs:cXunit}           number of seconds, sub-minute
-                                character 'c' before 'X' is used for padding
-                                (leave out character for no padding)
-                                unit is the string used after the number to denote its unit
-        {secs-nz:cXunit}        same as above, but does not display if number is zero
+        {secs:cXunit}           Number of seconds, sub-minute
+                                Character 'c' before 'X' is used for padding
+                                (leave out character for no padding, e.g. {secs:Xunit})
+                                Unit is the string used after the number to denote its unit
+        {secs-nz:cXunit}        Same as above, but does not display if number is zero
 
-        {sec-frac:cNXunit}      fraction of second, sub-second
+        {sec-frac:cNXunit}      Fraction of second, sub-second
                                 N determines the number of digits to take after decimal separator
-                                if N is not specified, then the smallest number of digits required
+                                If N is not specified, then the smallest number of digits required
                                 after decimal separator for a lossless representation is used
-                                character c is used as the decimal separator
-                                unit is the string used after the number to denote its unit
-        {secs-frac-nz:cNXunit}  same as above, but does not display if nanosecond count is
+                                Character c is used as the decimal separator
+                                Unit is the string used after the number to denote its unit
+        {secs-frac-nz:cNXunit}  Same as above, but does not display if nanosecond count is
                                 zero

*

val to_string : ?format:string -> t -> string
diff --git a/timedesc/Timedesc/index.html b/timedesc/Timedesc/index.html index d92b0d05..b0690a54 100644 --- a/timedesc/Timedesc/index.html +++ b/timedesc/Timedesc/index.html @@ -86,37 +86,52 @@ Time.t -> t

Accessors

val date : t -> Date.t
val ymd_date : t -> Date.Ymd.view
val iso_week_date : t -> Date.ISO_week_date.view
val iso_ord_date : t -> Date.ISO_ord.view
val ym : t -> Ym.t
val year : t -> int
val month : t -> int
val day : t -> int
val iso_week : t -> ISO_week.t
val iso_year : t -> int
val weekday : t -> weekday
val day_of_year : t -> int
val time : t -> Time.t
val time_view : t -> Time.view
val hour : t -> int
val minute : t -> int
val second : t -> int
val ns : t -> int
val is_leap_second : t -> bool
val tz : t -> Time_zone.t
val offset_from_utc : t -> Span.t local_date_time_result

Conversion

val to_timestamp : t -> timestamp local_date_time_result

to_timestamp loses information about leap second

val to_timestamp_single : t -> timestamp
  • raises Invalid_argument

    if to_timestamp does not yield a `Single result

val to_timestamp_float_s : t -> float local_date_time_result

Returns timestamp in seconds, fraction represent

val to_timestamp_float_s_single : t -> float
  • raises Invalid_argument

    if to_timestamp_float_s does not yield a `Single result

val of_timestamp : ?tz_of_date_time:Time_zone.t -> timestamp -> t option
val of_timestamp_exn : ?tz_of_date_time:Time_zone.t -> timestamp -> t
val of_timestamp_float_s : ?tz_of_date_time:Time_zone.t -> float -> t option
val of_timestamp_float_s_exn : ?tz_of_date_time:Time_zone.t -> float -> t

Comparison

val equal : t -> t -> bool
val compare_chrono_min : t -> t -> int

Compare based on ordering of min_of_local_date_time_result @@ to_timestamp _

Warning: compare_chrono_min x y = 0 does not imply equal x y

val compare_chrono_max : t -> t -> int

Compare based on ordering of max_of_local_date_time_result @@ to_timestamp _

Warning: compare_chrono_max x y = 0 does not imply equal x y

val compare_struct : t -> t -> int

Structural comparison, compare_struct x y = 0 implies equal x y

Ordering does not correspond to chronological ordering

Constants

val min_val : t
val max_val : t

Now

val now : ?tz_of_date_time:Time_zone.t -> unit -> t

Pretty-printing

exception Date_time_cannot_deduce_offset_from_utc of t
val pp : ?format:string -> unit -> Stdlib.Format.formatter -> t -> unit

Pretty-printing for date time.

Default format string:

{year} {mon:Xxx} {day:0X} {hour:0X}:{min:0X}:{sec:0X}{sec-frac:.} \
 {tzoff-sign}{tzoff-hour:0X}:{tzoff-min:0X}:{tzoff-sec:0X}

Format string specification:

{{               literal {
-{year}           year
-{mon:Xxx}        abbreviated month name (e.g. Jan), casing of 'x' controls the casing
-{mon:Xx*}        full month name (e.g. January), casing of first 'x' controls casing of first letter,
-                 casing of second 'x' controls casing of following letters
-{mon:cX}         month in number form (e.g. 01) character 'c' before 'X' is used for padding
-                 (leave out character for no padding)
-{day:cX}         month day (e.g.  1) character 'c' before 'X' is used for padding
-                 (leave out character for no padding)
-{wday:Xxx}       abbreviated weekday name (e.g. Sun), the casing of 'x' controls the casing
-{wday:Xx*}       full weekday name (e.g. Sunday), casing of first 'x' controls casing of first letter,
+{year}           Year
+
+{mon:Xxx}        Abbreviated month name (e.g. Jan), casing of 'X'/'x' controls the casing
+{mon:Xx*}        Full month name (e.g. January), casing of first 'X'/'x' controls casing of first letter,
                  casing of second 'x' controls casing of following letters
-{hour:cX}        hour in 24-hour format, character 'c' before 'X' determines padding
-                 (leave out character for no padding)
-{12hour:cX}      hour in 12-hour format, character 'c' before 'X' determines padding
-                 (leave out character for no padding)
-{min:cX}         minute, character 'c' before 'X' determines padding
-                 (leave out character for no padding)
-{sec:cX}         second, character 'c' before 'X' determines padding
-                 (leave out character for no padding)
-{ns}             nanosecond
-{sec-frac:cN}    fraction of second
-                 character c is used as the decimal separator
+{mon:cX}         Month in number form (e.g. 01) character 'c' before 'X' is used for padding
+                 (leave out character for no padding, e.g. {mon:X})
+
+{day:cX}         Month day (e.g.  1) character 'c' before 'X' is used for padding
+                 (leave out character for no padding, e.g. {day:X})
+
+{wday:Xxx}       Abbreviated weekday name (e.g. Sun), the casing of 'X'/'x' controls the casing
+{wday:Xx*}       Full weekday name (e.g. Sunday), casing of first 'X'/'x' controls casing of first letter,
+                 casing of second 'X'/'x' controls casing of following letters
+
+{hour:cX}        Hour in 24-hour format, character 'c' before 'X' determines padding
+                 (leave out character for no padding, e.g. {hour:X})
+
+{12hour:cX}      Hour in 12-hour format, character 'c' before 'X' determines padding
+                 (leave out character for no padding, e.g. {12hour:X})
+{am/pm:XX}       AM/PM indicator, the casing of 'X'/'x' controls the casing
+{am/pm:x.x.}     Same as above, but with periods, e.g. "a.m."
+
+{min:cX}         Minute, character 'c' before 'X' determines padding
+                 (leave out character for no padding, e.g. {min:X})
+
+{sec:cX}         Second, character 'c' before 'X' determines padding
+                 (leave out character for no padding, e.g. {sec:X})
+
+{ns}             Nanosecond
+
+{sec-frac:cN}    Fraction of second
+                 Character c is used as the decimal separator
                  N determines the number of digits to take after decimal separator
                  if N is not specified, then the smallest number of digits required
                  after decimal separator for a lossless representation is used
                  result is truncated to said number of digits
-{tzoff-sign}     time zone offset sign ('+' or '-')
+
+{tzoff-sign}     Time zone offset sign ('+' or '-')
                  raises Date_time_cannot_deduce_offset_from_utc if time zone offset cannot be calculated
-{tzoff-hour:cX}  time zone offset hour, follows same padding rule as "{hour:cX}"
+
+{tzoff-hour:cX}  Time zone offset hour, follows same padding rule as "{hour:cX}"
                  raises Date_time_cannot_deduce_offset_from_utc if time zone offset cannot be calculated
-{tzoff-min:cX}   time zone offset minute, follows same padding rule as "{min:cX}"
+
+{tzoff-min:cX}   Time zone offset minute, follows same padding rule as "{min:cX}"
                  raises Date_time_cannot_deduce_offset_from_utc if time zone offset cannot be calculated
-{tzoff-sec:cX}   time zone offset second, follows same padding rule as "{sec:cX}"
+
+{tzoff-sec:cX}   Time zone offset second, follows same padding rule as "{sec:cX}"
                  raises Date_time_cannot_deduce_offset_from_utc if time zone offset cannot be calculated
val to_string : ?format:string -> t -> string

String conversion using pp.

val pp_rfc3339 : ?frac_s:int -> unit -> Stdlib.Format.formatter -> t -> unit

Pretty-prints according to RFC3339, e.g. 2020-01-20T13:00:00.0001+10.

frac_s defaults to as many digits as required for a lossless representation.

  • raises Invalid_argument

    if frac_s < 0 || frac_s > 9

val pp_rfc3339_milli : Stdlib.Format.formatter -> t -> unit
val pp_rfc3339_micro : Stdlib.Format.formatter -> t -> unit
val pp_rfc3339_nano : Stdlib.Format.formatter -> t -> unit
val to_rfc3339 : ?frac_s:int -> t -> string

String conversion using pp_rfc3339.

val to_rfc3339_milli : t -> string
val to_rfc3339_micro : t -> string
val to_rfc3339_nano : t -> string
val pp_iso8601 : ?frac_s:int -> unit -> Stdlib.Format.formatter -> t -> unit

Alias to pp_rfc3339

val pp_iso8601_milli : Stdlib.Format.formatter -> t -> unit
val pp_iso8601_micro : Stdlib.Format.formatter -> t -> unit
val pp_iso8601_nano : Stdlib.Format.formatter -> t -> unit
val to_iso8601 : ?frac_s:int -> t -> string

Alias to to_rfc3339

val to_iso8601_milli : t -> string
val to_iso8601_micro : t -> string
val to_iso8601_nano : t -> string
val pp_rfc9110 : Stdlib.Format.formatter -> t -> unit

Warning: Subsecond value is truncated

val to_rfc9110 : t -> string

Warning: Subsecond value is truncated

val pp_http : Stdlib.Format.formatter -> t -> unit

Alias to pp_rfc9110

val to_http : t -> string

Alias to to_rfc9110

Parsing

val of_iso8601 : string -> (t, string) Stdlib.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.

val of_iso8601_exn : string -> t
val of_rfc9110 : string -> (t, string) Stdlib.result

Parses RFC9110/RFC5322 (HTTP) date time.

More specifically, parses the following permissively:

  • IMF-fixdate
  • RFC850
    • If two-digit year >= 50, then it is treated as 1900 + year, otherwise treated as 2000 + year
  • ANSI C's asctime() format

Weekday is not checked to be correct.

val of_rfc9110_exn : string -> t
val of_http : string -> (t, string) Stdlib.result

Alias to of_rfc9110

val of_http_exn : string -> t

Alias to of_rfc9110_exn

Timestamp

module Timestamp : sig ... end

Timestamp specific functions

Interval

module Interval : sig ... end

Time zone-less date time

module Zoneless : sig ... end

Other date time systems

module ISO_week_date_time : sig ... end
module ISO_ord_date_time : sig ... end

Misc

module Time_zone_info : sig ... end
module Utils : sig ... end