CC: | bug-Date-Manip [...] rt.cpan.org |
Subject: | Re: Date-Manip 6.30 %u format bug |
Date: | Thu, 23 Aug 2012 22:00:00 -0400 |
To: | Roland Roberts <roland [...] astrofoto.org> |
From: | Sullivan Beck <sbeck [...] cpan.org> |
On 8/23/2012 6:15 PM, Roland Roberts wrote:
Show quoted text
>
> 258 roland> perl -MDate::Manip -e '$dow =
> UnixDate(ParseDate("now"),"%u"); print "$Date::Manip::VERSION => dow =
> $dow\n";'
> 6.30 => dow = Thu Aug 23 18:11:59 EDT 2012
>
> Since today is Thursday, I had expect the answer to be 4.
>
> 260 roland> date +%u
> 4
>
> I'm not sure when it began doing this; the application with this code
> was recently migrated from a RHEL 4.x to a 5.x host and picked up new
> versions of everything include Date-Manip. Setting DATE_MANIP=DM5 has
> not effect (not that I expected it to, but...).
Please read the Date::Manip::Date man page. The '%u' format in
Date::Manip has never referred to the day of week, so it's never been
4. The correct format is '%w'.
%u is a date string of the form you show above, so Date::Manip is
performing as documents, AND as it always has, so I'm not sure how you
ever got a different behavior in the past.