Since it’s the new year, here’s a question. What is the maximum number of weeks in a year?
Since it’s the new year, here’s a question. What is the maximum number of weeks in a year?
@Archimage now I’m puzzled. Let me ponder :)
@danielsantos Yup. The normal number is 52. You get 53 on a leap year when the year starts on a new week, and ends on a new week. There are 52 seven day weeks. 52 or 53 calendar weeks. Programmers need to account for 53 weeks.
@Archimage yay! Now that I got the right answer I’m satisfied :) thanks for the explanation 😃
@danielsantos No problem. It's a fun question for programmers. Most get it wrong when dealing with calendar data. Lots of code blows up on 53 week years and they wonder why.
@Archimage when I saw your question I remembered algorithms and data structures. I even remembered that to find out whether a year is a leap one or not, one has to observe its division by 4 remainder. So when I answered 52 I kind of knew I had missed it… but it’s been literally years since I don’t code anything. Nice trip down memory lane…