General information
Category:
Coding, syntax & commands
The following formula gives you the following day of week after (including) the ldDate date:
ldDate + mod(lnDay - dow(ldDate, 1), 7)
where lnDay = 1 (Sunday), = 2 (Monday), etc.
If you want the 3rd Thursday of the month, call it with ldDate = the first day of the month and lnDay = 5 and add 14:
ldDate + mod(lnDay - dow(ldDate, 1), 7) + 14
To get the first day of the month when you have the month and the year:
ld1stDay = ctod("^" + str(lnYear, 4) + "/" + str(lnMonth, 2) + "/01")
Vlad
>For example, how would I calculate the dates for every third Thursday of the month for the next six months and store those dates in an array for later processing.
>
>If anyone has done this type of calculation and is willing to share with me the solution, I would greatly appreciate it. Hate to reinvent the wheel.
>
>TIA,
>
>James Moore
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only