package spotlib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Temporal.DateSource

Sourcetype t = {
  1. year : int;
  2. month : int;
  3. day : int;
}

Comparison should work correctly between valid dates

include Mtypes.Comparable with type t := t
Sourceval compare : t -> t -> int
Sourceval equal : t -> t -> bool
Sourcemodule Infix : sig ... end
Sourceval to_string : t -> string

Prints t in ISO8601's YYYY-MM-DD format

Sourceexception Parse_error
Sourceval of_string_exn : string -> t
Sourceval of_string : string -> (t, [> `Exn of exn ]) result

Parses string of ISO8601's YYYY-MM-DD format

Sourceval yday : t -> int

1--365 or 366

Sourceval wday : t -> int

0--6, 0 is Sunday

Sourceval diff : t -> t -> int
Sourceval random_with_invalid : unit -> t

Random value generator which may contain invalids like 2000/02/31

Sourceval random : unit -> t

Random value generator with valid dates from 1900-01-01 to 2099-12-31. For checking more boudnary conditions, 1,28,29,30 and 31 are chosen more frequently as days than the others.

Sourceval random_2038 : unit -> t

Same as random but culled so that the values are between 1970-01-01 and 2037-12-31

OCaml

Innovation. Community. Security.