_HowLongUntilMyRetirementMoment_v4
Project Description
I earlier versions I calculated the months. However that was not accurate enough.
I want to skip the months and instead go from weeks left straight to years left.
For that I need to determine whether a year has 365 or 366 days, which is easy enough - see leapyear block.
But to go from weeks to years I also need to know if that particular year has 52 or 53 weeks. That can be determined as follows:
Check Day of Week for January 1st
Why is this important? A year always has at least 52 full weeks (52 * 7 = 364 days).
If a year has 365 days, there's 1 "extra" day. If this extra day is part of a "partial week" at the beginning of the year that extends into a 53rd week, then the year has 53 weeks. This happens if January 1st is a Thursday.
If a year has 366 days (leap year), there are 2 "extra" days. These extra days can create a 53rd week if January 1st is a Wednesday or Thursday.
Created June 17, 2025
Last updated June 19, 2025
Published June 18, 2025