package mrmime

  1. Overview
  2. Docs
module Day : sig ... end
module Month : sig ... end
module Zone : sig ... end
type t = {
  1. day : Day.t option;
  2. date : int * Month.t * int;
  3. time : int * int * int option;
  4. zone : Zone.t;
}

Type of date according RFC 822 / RFC 2822 / RFC 5322.

Constructors.

val make : ?day:Day.t -> (int * Month.t * int) -> (int * int * int option) -> Zone.t -> (t, [> `Msg of string ]) result

make ?day (year, month, day) (hh, mm, ss) tz returns a date corresponding to month/day/year hh:mm:ss date-time with time zone tz. ?day (which is the day in the 7-day week) and day must correspond according of timestamp to month/day/year and time zone tz. If it's not the case, make returns an error.

(year, month, day) (hh, mm, ss) must correspond to a valid POSIX timestamp. The date-time must be in the range of 0000-01-01 00:00:00 UTC and 9999-12-31 23:59:59.99 UTC. Otherwise, make returns an error.

If ss = None, seconds are 0. If ?day = None, it will be the day in the 7-day week of POSIX timestamp corresponding to date-time (year, month, day) (hh, mm, ss) expressed in the time zone offset tz.

make relies on Ptime.of_date_time. To completely understand implication of that, you should read basics about ptime.

val to_ptime : t -> (Ptime.t * int, [> `Msg of string ]) result

to_ptime t returns a POSIX timestamp Ptime.t.

val of_ptime : zone:Zone.t -> Ptime.t -> t

of_ptime ~zone t is date-time t of POSIX timestamp t. zone hints the time zone offset used for the resulting daytime Day.t component.

Pretty-printers.

val pp : Format.formatter -> t -> unit

Equals & compares.

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

Decoder of date.

module Decoder : sig ... end

Encoder of date.

module Encoder : sig ... end
OCaml

Innovation. Community. Security.