Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

djberg96 (2603)

djberg96
  (email not shown publicly)

Journal of djberg96 (2603)

Monday March 04, 2002
01:14 PM

Minor nit

[ #3285 ]
Why is it that Unix treats Sunday as '0' (for day of the week), but Date::Calc treats Sunday as '7'? Is it because '0' could be interpreted as "false"? Ruby also does this.

To confuse us even more, the localtime function treats Sunday as '0'.

Could we make up our minds? Anyone know how other languages treat Sunday?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • If you're having trouble keeping 0 and 7 straight for Sunday, remember that 7 mod 7 ==0.
  • there's at least one module that accepts both 0 and 7 as Sunday (like linux's cron). But, yeah, the simplest thing to do is just mod 7 anything that comes out.
    --
      ---ict / Spoon