Week Numbers

BlitzMax Forums/BlitzMax Beginners Area/Week Numbers

wedoe,

1. Find out what day of week 4th og January is. This date is always in week 1 !
2. If 4Th of January is earlier in the week than Thursday we are still in week 52 or 53 of the previous year (Week starting on Monday)


Damn I wish I was at home so I could check this against my code. :)
I'm pretty sure my code tells me how the 1st of January related to the first Thursday in Jan - which also has to be in week 1.

If #2 is true:
3. If in the previous year the 1st of January were a Thursday, then 1st of January this year are week 53 ! (Else 52)
4. If in the previous year the 1st of January were a Wednesday and last year were a leapyear, then 1st of January this year are week 53 ! (Else 52)


Thanks for that - I'll see how this relates to my code when I get chance. I got as far as determining whether the 1st of Jan was in week 1, or week 52/53 but not as far as whether it was 52 or 53 - if that makes sense? Nice one though, you've given something extra to work with much appreciated. :)

Thanks for the other codes snippets, again appreciated. I already have functions for determining leapyear and day name. Your leapyear function works very similar to my own - I guess it would really. Thanks again. :)