Subject: | format_datetime() generates slightly inappropriate results |
Hi,
The code
use DateTime::Format::Mail;
my $dt = DateTime->new(
year => 2014,
month => 4,
day => 9,
time_zone => 'GMT');
print DateTime::Format::Mail->format_datetime($dt),
"\n";
outputs this.
Wed, 09 Apr 2014 00:00:00 -0000
There are two problems.
Important:
* If time zone has no difference from UTC, it is formatted as "-0000", not "+0000".
Relatively unimportant:
* Day of month is always 2-digits such as "09". Though ABNF in RFC 822 and its successors allow it, examples appear in RFC 2822 and so on use 1-digit for the days before 10th.
Regards,
--- Soji