I was trying to calculate the difference between 2 dates. I was using code that I found on a thread that used Clock1.Duration and Clock1.makeDate for the Start and End of the duration.
The problem was I was getting the wrong results where the dates were on different sides of the Daylight savings crossover dates.
26-March-2022 to 29-March-2022 was giving me a result of 2 days instead of 3. It seemed to be generating the two dates (one with dst the other not) and then calculating the difference.
I prefer my solution to round the millisecond difference between "start" to "end" dates. This works fine from my testing and doesn't require conditionals. (BTW: your condition doesn't work for april etc..., it still floors the result until the end of Daylight savings). (if the end-date was 30th-june-2022 still requires +1 as it is in DST and start-date isn't)
The problem with the DurationToDays function is a rounding vs flooring. The DurationToDays function seems to Floor the result (2.958333 days is reported as 2), where a Rounded result is probably what people will expect.