Skip Menu |

This queue is for tickets about the Mail-Box CPAN distribution.

Report information
The Basics
Id: 7898
Status: resolved
Priority: 0/
Queue: Mail-Box

People
Owner: Nobody in particular
Requestors: aa29 [...] mail.ru
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Mail::Message::Field::toDate() generates dates which are not parsed by Mail::Message::timestamp()
Mail::Message::Field::toDate() generates dates which are not parsed by Mail::Message::timestamp() afterwhile on my system (WinXP/Russian locale). Mail::Message::timestamp() uses Date::parse::str2time() to parse 'date' header and this fails on 'Wed, 06 Oct 2004 13:14:22 Russian Daylight Time'. Work around is to explicit specify date like my $msg = Mail::Message->build(Subject => 'foo', Date => time2str("%a, %e %b %Y %T %z", time())); But may be it's worth using Date::Format::time2str() just to be symmetric with Mail::Message::Field::dateToTimestamp() which uses Date::Parse::str2time()? Code snippet: use Mail::Message::Field; use Date::Format qw(time2str); use Date::Parse qw(str2time); my $date1 = Mail::Message::Field->toDate, "\n"; my $date2 = time2str("%a, %e %b %Y %T %z", time()), "\n"; my $stamp1 = str2time($date1, 'GMT') || 'oops!'; my $stamp2 = str2time($date2, 'GMT') || 'oops!'; print "Time stamp for '$date1': $stamp1\n"; print "Time stamp for '$date2': $stamp2\n"; Does on my system: Time stamp for 'Wed, 06 Oct 2004 13:32:00 Russian Daylight Time': oops! Time stamp for 'Wed, 6 Oct 2004 13:32:00 +0400': 1097055120 Thanks a lot for your previous quick responses.
[guest - Wed Oct 6 05:33:38 2004]: Show quoted text
> Mail::Message::Field::toDate() generates dates which are not parsed by > Mail::Message::timestamp() afterwhile on my system (WinXP/Russian > locale).
According to my manual of strftime() [Linux] %z The time-zone as hour offset from GMT. Required to emit RFC822-conformant dates (using "%a, %d %b %Y %H:%M:%S %z"). (GNU) Show quoted text
> Mail::Message::timestamp() uses Date::parse::str2time() to parse > 'date' header and this fails on 'Wed, 06 Oct 2004 13:14:22 Russian > Daylight Time'.
So apparently your %z is incompatible with mine... What OS are you using? strftime is much faster than time2str, so maybe I can better make a special case for your OS.
[MARKOV - Wed Nov 24 10:38:20 2004]: Show quoted text
> So apparently your %z is incompatible with mine... What OS are you > using? strftime is much faster than time2str, so maybe I can better > make a special case for your OS.
Regarding your bug-report, I asked you which operating system you are using to implement a work-aroung. I still didn't get a reponse. I'll close the bug as "unreproducable" if you cannot supply me with more information.
From: aa29 [...] mail.ru
I haven't got mailed your posting on Nov 24, so I couldn't reply in proper time. Sorry. I use Windows XP (eng) with Russian locale. IMHO, this issue may be locale dependent. perl: 5.8.5 Date::Format: 2.22 Date::Parse: 2.27
No, the issue is libc dependent. Glibc interprets %z differently from other implementations, because POSIX doesn't defined it so everyone have their own ideas about it. I'll work-around this issue for the next release. Thanks for the report.