package timedesc

  1. Overview
  2. Docs
type t

Accessors

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

Comparison

val equal : t -> t -> bool
val lt : t -> t -> bool
val le : t -> t -> bool
val gt : t -> t -> bool
val ge : t -> t -> bool
val compare : t -> t -> int

Arithmetic

val add : days:int -> t -> t
val sub : days:int -> t -> t
val diff_days : t -> t -> int

Pretty printing

val pp_rfc3339 : Stdlib.Format.formatter -> t -> unit
val to_rfc3339 : t -> string

Parsing

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

Sexp

val to_sexp : t -> CCSexp.t
val to_sexp_string : t -> string
val of_sexp : CCSexp.t -> (t, string) Stdlib.result
val of_sexp_string : string -> (t, string) Stdlib.result
val pp_sexp : Stdlib.Format.formatter -> t -> unit

Gregorian calendar

module Ymd : sig ... end
val of_ym : Ym.t -> day:int -> (t, Ymd.error) Stdlib.result
val of_ym_exn : Ym.t -> day:int -> t

ISO week date calendar

module ISO_week_date : sig ... end
val of_iso_week : ISO_week.t -> weekday:weekday -> t

ISO ord date calendar

module ISO_ord : sig ... end
OCaml

Innovation. Community. Security.