CC: | imapsync [...] linux-france.org |
Subject: | %z change in 6.x breaks rfc 2822 (email) date format and strftime(3) compatibility |
Date: | Wed, 09 Dec 2009 02:07:33 +0100 |
To: | bug-Date-Manip [...] rt.cpan.org |
From: | Gilles LAMIRAL <gilles.lamiral [...] laposte.net> |
Hello,
First thanks to develop this perl module Date::Manip, it is very useful.
I use this module to clean email "Date:" header, like this:
$d = UnixDate(ParseDate($d), "%d-%b-%Y %H:%M:%S %z");
Like it is said on page
http://search.cpan.org/~sbeck/Date-Manip-6.04/lib/Date/Manip/Changes5to6.pod
%z format changed:
%z format
In Date::Manip 5.xx, the %z format would give an offset in the form: -0500.
Now it gives it in the form: -05:00:00
I don't know why the change was made, may be for a good reason.
The change breaks the date email format.
http://www.faqs.org/rfcs/rfc2822.html
3.3. Date and Time Specification
[...]
zone = (( "+" / "-" ) 4DIGIT) / obs-zone
It also breaks the strftime function compatibility. Here is the man page:
man 3 strftime
[...]
%z The time-zone as hour offset from GMT. Required to emit RFC 822-conformant dates
(using "%a, %d %b %Y %H:%M:%S %z"). (GNU)
I suggest to use another letter than %z to give the new form -05:00:00
and keep %z for the form -0500. If you disagree we still need to have the
old behavior to avoid ugly workaround with Date::Manip::VERSION.
All C and rfc2822 coders (and their program users) will complain about this change.
If this bug is already fixed, I'm sorry to mention it (I didn't find it in the bug list).
Thanks in advance for your feedback,
and thanks again for developing free software.
--
Au revoir, 02 99 64 31 77
Gilles Lamiral. France, Chavagne (35310) 06 20 79 76 06