Information générale
Catégorie:
Codage, syntaxe et commandes
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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement