Subject: | Rfc2060_datetime() needs to include a timezone |
The formal grammar specification for date-time in RFC3501 (updated from
2060) requires a time zone:
date-time = DQUOTE date-day-fixed "-" date-month "-" date-year
SP time SP zone DQUOTE
zone = ("+" / "-") 4DIGIT
; Signed four-digit value of hhmm representing
; hours and minutes east of Greenwich (that is,
; the amount that the given time differs from
; Universal Time). Subtracting the timezone
; from the given time will give the UT form.
; The Universal Time zone is "+0000".
c.f. http://www.isi.edu/in-notes/rfc3501.txt
This is important for APPEND commands. Some IMAP servers (e.g. Gmail)
reject APPEND with an invalid timestamp.
I suggest a syntax like this:
Rfc2060_datetime( $epoch_secs, $zone )
$zone should be in the same format as the zone grammer. If invalid or
not supplied, just default to "+0000".
As a side note, there is no check that the first argument is defined.
If it isn't defined, you should probably just default to 0.