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
val pp_rfc5322 : Stdlib.Format.formatter -> t -> unit
val to_rfc5322 : t -> string

Parsing

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

    if of_iso8601 fails

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