Convert Internet Message Format date and time strings to and from POSIX times.
Supported Internet Message Format specifications are RFC5322, as well as the obsolete RFC2822 and RFC822.
Convert a
Time.Zone
and a
Time.Posix
to an
Internet Message Format
date and time string.
Examples:
import Time
epoch : Time.Posix
epoch =
Time.millisToPosix 0
Imf.DateTime.fromPosix Time.utc epoch
--> "Thu, 01 Jan 1970 00:00:00 +0000"
Imf.DateTime.fromPosix (Time.customZone 60 []) epoch
--> "Thu, 01 Jan 1970 01:00:00 +0100"
Imf.DateTime.fromPosix
(Time.customZone -300 [])
(Time.millisToPosix 1357891860000)
--> "Fri, 11 Jan 2013 03:11:00 -0500"Internet Message Format date and time
Parser
for elm/parser.
Convert from an Internet Message Format date and time string to a POSIX time.
Regardless of which time zone the string uses, this function normalizes it and returns a time in UTC.
In accordance to RFC2822 then RFC5322:
-0000UTC offset.If parsing fails, a
List Parser.DeadEndis returned. Installelm/parserand seeParser.DeadEndfor producing helpful error messages.Examples: