Dear All,
I think I have fixed a bug in avr-libc-2.0.0include/util/eu_dst.h where
the summer time was being imposed after summer time had finished, and
vice-versa.
To decipher the code:-
if (month == MARCH) {
if (final_sunday < today)
return 0; /* should be ONE_HOUR */
if (final_sunday > today)
return ONE_HOUR; /* should be 0 */
....
}
/* OCTOBER */
if (final_sunday < today)
return ONE_HOUR; /* should be 0 */
if (final_sunday > today)
return 0; /* should be ONE_HOUR */
...
Cheers,
Peter Welch.
diff -ur old/eu_dst.h new/eu_dst.h
--- old/eu_dst.h 2024-10-30 12:37:50.832265251 +0000
+++ new/eu_dst.h 2024-10-30 12:39:19.785250920 +0000
@@ -92,17 +92,17 @@
if (month == MARCH) {
if (d < mday)
- return 0;
- if (d > mday)
return ONE_HOUR;
+ if (d > mday)
+ return 0;
if (hour < 2)
return 0;
return ONE_HOUR;
}
if (d < mday)
- return ONE_HOUR;
- if (d > mday)
return 0;
+ if (d > mday)
+ return ONE_HOUR;
if (hour < 2)
return ONE_HOUR;
return 0;