Post Reply 
Calendar functions
04-02-2017, 10:13 AM (This post was last modified: 04-02-2017 10:46 AM by JMB.)
Post: #4
RE: Calendar functions
(04-02-2017 08:56 AM)ggauny@live.fr Wrote:  Hi JMB,

Just corrected a little typo and add Day_of_week and Date of Easter (this one for complete range).

Thanks for your comments and additions. Just one thing, your function Day_of_week does the same as the built-in function DAYOFWEEK with the difference that it returns 0 for Sunday, while DAYOFFWEEK returns 7. If you want to keep the name "Day_of_Week", it's easier:
PHP Code:
Day_of_Week(d)
// d:date → 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa, 7=Su
BEGIN
  DAYOFWEEK
(d);
END
And if you want 0 for Sunday:
PHP Code:
Day_of_Week(d)
// d:date → 0=Su, 1=Mo, 2=Tu, 3=We, 4=Th, 5=Fr, 6=Sa
BEGIN
  DAYOFWEEK
(dMOD 7;
END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Calendar functions - JMB - 04-01-2017, 10:07 AM
RE: Calendar functions - ggauny@live.fr - 04-01-2017, 02:15 PM
RE: Calendar functions - ggauny@live.fr - 04-02-2017, 08:56 AM
RE: Calendar functions - JMB - 04-02-2017 10:13 AM



User(s) browsing this thread: 1 Guest(s)