|
@@ -84,8 +84,15 @@ bool IsDst(int Day, int Date, int Month, int Hour_24) {
|
|
|
if (Month < 3 || Month > 11) return false;
|
|
|
|
|
|
if (Month > 3 && Month < 11) return true;
|
|
|
-
|
|
|
- if (Month == 3) return ((Date - Day) >= 8) && (Hour_24 >= 2);
|
|
|
-
|
|
|
- return ((Date - Day) <= 0) && (Hour_24 < 2);
|
|
|
+
|
|
|
+ int prevSunday = Date - Day;
|
|
|
+
|
|
|
+ if (Month == 3) {
|
|
|
+ if (prevSunday < 8) return false;
|
|
|
+ if (prevSunday > 14) return true;
|
|
|
+ return (Date == prevSunday) ? Hour_24 >= 2 : true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (prevSunday <= 0) return true;
|
|
|
+ return (prevSunday == Date && Date <= 7) ? (Hour_24 < 2) : false;
|
|
|
}
|