LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab and the 7th day (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-and-the-7th-day-745677/)

WildDrake! 08-06-2009 06:45 PM

crontab and the 7th day
 
This isn't by any means a vital question, but I just found it curious and alien to my thinking:

Concerning the crontab portion of the Rute manual, why is Sunday depicted as day 7, when the 7 day weekly cycle, starting with Sunday as the 1st day of the week and Saturday (the Old and New Testament Sabbath) as the 7th day of the week, has existed for thousands of years?

pljvaldez 08-06-2009 06:56 PM

Because Sunday is actually 0 or 7. Typically programmers count from 0, so the actual range is 0-6 and 7 is just 0 again.

WildDrake! 08-06-2009 07:16 PM

Yes. I was thinking about that starting at 0 thing that computer scientist use, but for crontab to stay consistent with this, does each month start with day 0 or (len(month)) as the first day of the month in cron? And for that matter, do the months start with month 0 and end with month 11?

pljvaldez 08-06-2009 07:27 PM

man crontab

It appears month and day of month do not follow that convention, but hour, minute, and day of week do. It's easy to see where starting day of month and month at 0 would be confusing for anyone who uses a western calendar. But day of week is sort of arbitrary and times follow a standard 24 hour time.

WildDrake! 08-06-2009 08:09 PM

Thanks. Now that I have discussed it, it surely will stick. Have a great day!


All times are GMT -5. The time now is 08:21 AM.