Module MrMime_date

module MrMime_date: sig .. end
Module Date

type day = Rfc5322.day = 
| Mon
| Tue
| Wed
| Thu
| Fri
| Sat
| Sun
Day of week
See also RFC5322 § Date and Time Specification
type month = Rfc5322.month = 
| Jan
| Feb
| Mar
| Apr
| May
| Jun
| Jul
| Aug
| Sep
| Oct
| Nov
| Dec
Month
See also RFC5322 § Date and Time Specification
type zone = Rfc5322.zone = 
| UT (*
Universal time (identical to +0000)
*)
| GMT (*
Greenwich Mean time (identical to +0000)
*)
| EST (*
Eastern Standard time (identical to -0500)
*)
| EDT (*
Eastern Daylight Savings time (identical to -0400)
*)
| CST (*
Central Standard time (identical to -0600)
*)
| CDT (*
Central Daylight Savings time (identical to -0500)
*)
| MST (*
Mountain Standard time (identical to -0700)
*)
| MDT (*
Mountain Daylight Savings time (identical to -0600)
*)
| PST (*
Pacific Standard time (identical to -0800)
*)
| PDT (*
Pacific Daylight Savings time (identical to -0700)
*)
| Military_zone of char (*
The character military zones were defined in a non-standard way in RFC822 and are therefore unpredictable in their meaning.

The original definitions of the military zones A through I are equivalent to +0100 through +0900, respectively; K, L, and M are equivalent to +1000, +1100, and +1200, respectively; N through Y are equivalent to -0100 through -1200 respectively; and Z is equivalent to +0000.

*)
| TZ of int (*
TZ +hhmm means +(hh * 60 + mm) minutes, and TZ -hhmm means -(hh * 60 + mm) minutes.

Accoding to the standard RFC5322, mm must be within the range 00 through 59. MrMime does not check that.

*)
Timezone
See also RFC5322 § Date and Time Specification
type date = Rfc5322.date = {
   day : day option; (*
Accoding to the standard RFC5322, the day (if included) must be the day implied by the date. MrMime does not check that.
*)
   date : int * month * int; (*
(day, month, year):
  • day is the numeric day of the month. According to the standard RFC5322, the day must be between 1 and the number of days allowed for the specified month (in the specified year). MrMime does not check that.
  • year is any numeric year 1900 or later.

*)
   time : int * int * int option; (*
According to the standard RFC5322, time must be in the range 00:00:00 through 23:59:60 (the number of seconds allowing for a leap second; see RFC1305). MrMime does not check that.
*)
   zone : zone;
}
Date
See also RFC5322 § Date and Time Specification
val pp_zone : Format.formatter -> zone -> unit
pp_zone prints an human readable representation of zone.
val pp_month : Format.formatter -> month -> unit
pp_month prints an human readable representation of month.
val pp_day : Format.formatter -> day -> unit
pp_day prints an human readable representation of day.
val pp : Format.formatter -> date -> unit
pp date prints an human readable representatation of date.
module Encoder: sig .. end
module Decoder: sig .. end
val to_string : date -> string
to_string date formats the date date accoding to a RFC5322.
val of_string : ?chunk:int -> string -> date option
of_string ~chunk:1024 buf parses an RFC5322 date starting at 0 in buf.

This function allocates a internal buffer with chunk size (default to 1024).

val of_string_raw : ?chunk:int -> string -> int -> int -> (date * int) option
of_string_raw ~chunk:1024 buf off len parses an RFC5322 date starting at off in buf to a tuple (date, count) with: This function allocates a internal buffer with chunk size (default to 1024).
val equal : date -> date -> bool
equal a b is true iff a and b are the same date.