If you try this:
you can see, the days of e.g. March are not correct because the daylight saving time has been changed here.
So try the following:
getDaysOfMonth.aia (11.8 KB)
If you try this:
you can see, the days of e.g. March are not correct because the daylight saving time has been changed here.
So try the following:
getDaysOfMonth.aia (11.8 KB)
Good work. But don't we really only need to check February? - assumes working with gregorian calendar - none of the other months change...
Yes, but if it were to be calculated (for whatever reason) the decisive factor here is daylight saving time, which, as I have shown, would repeatedly lead to errors in the calculation.
For example, if you want to get the duration from this:
You are getting an incorrect duration ... (missing 3600000 millis).
Ok, you create these dates, but there is no duration calculation.
By using the "day of the year" number, provided within the instant, you overcome any issues with DST (which is a PITA )
Since these values simply return: 1, 2, 3, ... 364, 365.