in reply to Inscrutable test failure

On my system (localtime(UnixDate(ParseDate('last sunday'), "%s") || time))[6] returns 0 and (localtime(UnixDate(ParseDate('last saturday'), "%s") || time))[6] returns 6....so I think this obviously varies between systems.

On the other hand... Date_IsWorkDay(ParseDate('last saturday')) works perfectly


___________
Eric Hodges

Replies are listed 'Best First'.
Re^2: Inscrutable test failure
by dsheroh (Monsignor) on Oct 26, 2007 at 21:37 UTC
    It shouldn't vary between systems. Per the documentation of localtime, "$wday is the day of the week, with 0 indicating Sunday and 3 indicating Wednesday." Sunday should universally be 0 and Saturday should be 6.

    In the test, I set the list of weekdays to not be the default M-F to verify that nonstandard ranges are supported, but didn't think to mention that in the initial post. Sorry about the confusion there.

      Ahhh that clears up the other post I made too. I though in your mask you where expecting 0 and 1 to be saturday and sunday. Never mind both my posts it would seem.


      ___________
      Eric Hodges