Module Timedesc.Date

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_rfc9110 : Stdlib.Format.formatter -> t -> unit
val to_rfc9110 : t -> string
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
val of_iso8601_exn : string -> t

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