Message
From
20/10/2016 01:21:46
 
 
To
19/10/2016 20:31:42
General information
Fórum:
Visual FoxPro
Category:
Programação, sintaxe e comandos
Miscellaneous
ID da thread:
01642129
ID da mensagem:
01642131
Views:
82
>The application has to determine how many occurrences of a given day of the week occurred in a given calendar month.
>
>For example- How many Mondays (or any other specified day of the week) were there in February, 2016?
>I can see how to get the answer by looping through all the days in the month in question, but is there a slicker way?

Shouldn't be that hard, Bill

- Take the first day of the month
- Determine what day of the week it is, if not a Monday, advance n days until the first Monday of the month ( do not use a loop)
- Then see how many more days there are in that month
- integer division by 7
Gregory
Previous
Responder
Mapa
View