CC: | bug-Date-Manip [...] rt.cpan.org |
Subject: | Re: Date-Manip 6.30 %u format bug |
Date: | Thu, 23 Aug 2012 23:26:14 -0400 |
To: | sbeck [...] cpan.org |
From: | Roland Roberts <roland [...] astrofoto.org> |
On 08/23/2012 10:00 PM, Sullivan Beck wrote:
Show quoted text
> On 8/23/2012 6:15 PM, Roland Roberts wrote:
Sorry, I hadn't read far enough to see the list Date::Manip::Date. The
man page for date(1) claims %u is day of the week, 1-7 and
Date::Manip::DM6 said the formats were "roughly identical to the format
strings used by the UNIX date(1) command" and I stopped there.
I'm also puzzled because this particular routine is several years old
and I have no idea when it started failing or who the last person to
modify it was.
roland
--
PGP Key ID: 66 BC 3B CD
Roland B. Roberts, PhD RL Enterprises
roland@rlenter.com 6818 Madeline Court
roland@astrofoto.org Brooklyn, NY 11220
>>
>> 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.
>
>