in reply to Re^2: Inscrutable test failure
in thread Inscrutable test failure

I think you want to use Date_DayOfWeek then, so something like Date_DayOfWeek(UnixDate(ParseDate('last saturday'),'%m', '%d','%y'))


___________
Eric Hodges

Replies are listed 'Best First'.
Re^4: Inscrutable test failure
by dsheroh (Monsignor) on Oct 26, 2007 at 21:49 UTC
    What would be the advantage of using that rather than (localtime ($date))[6]? The only differences I see, based on the Date::Manip docs, seem to be whether the date is specified in epoch seconds or as m/d/y and whether Sunday is considered to be day 0 or day 7.

    If there is an advantage, I can definitely switch, but I personally prefer to handle dates internally as epoch times and, in this case, to use localtime to get the day of week directly from that value rather than converting the epoch time to m/d/y so that m/d/y can be given to Date_DayOfWeek. I suppose I don't want to change it without knowing why I'm changing it.

      Date::Manip promises to return 1-7 mapping to mon-sun. My imperssion was that it will do this regardless of local, timezones, etc. How you get the data to pass wot Date_DayOfWeek doesn't realy matter as far as I can tell though.


      ___________
      Eric Hodges