Module Date


module Date: Libs.ExtNetdate.Netdate
Support for dates, including parsing and formating.
Author(s): Gerg Stolpmann (OCamlNet module), David Teller


Note
Several functions of this module are defined with respect to a base date called the epoch. While the definition of epoch may be system-dependent, most systems take as epoch 00:00:00 UTC, January 1, 1970.

type t = {
   year : int; (*the complete year*)
   month : int; (*a month, between 1 and 12*)
   day : int; (*a day, between 1 and 31*)
   hour : int; (*the number of hours since midnight, between 0 and 23*)
   minute : int; (*the number of minutes since the beginning of the hour, between 0 and 59*)
   second : int; (*the number of seconds since the begining of the minute, between 0 and 59*)
   zone : int; (*the local zone offset, in minutes of advance wrt UTC. For instance, 60 = UTC+0100.*)
   week_day : int; (*the number of days since sunday, between 0 and 6 Note As a special exception, week_day may be -1, if the day of the week is unknown*)
}
The representation of a date in time.
val now : unit -> t
val localzone : int
val create : ?zone:int -> float -> t
val parse : string -> t
val since_epoch : t -> float
val parse_epoch : string -> float
val format_to : 'a Extlib.InnerIO.output -> ?fmt:string -> t -> unit
val format : ?fmt:string -> t -> string
val mk_mail_date : ?zone:int -> float -> string
val mk_usenet_date : ?zone:int -> float -> string
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val print : 'a Extlib.InnerIO.output -> t -> unit