australian daylight saving time only from 02:00 to 03:00

This commit is contained in:
2023-03-22 12:48:34 +01:00
parent 5d29369bd7
commit cdbb81e97d

View File

@ -79,6 +79,12 @@ bool isAustralianDaylightTime(local_clock::time_point timeStamp)
const date::sys_days startOfDst = dateTime.date.year()/October/Sunday[0];
const date::sys_days endOfDst = dateTime.date.year()/April/Sunday[0];
if (dateTime.date == startOfDst)
return dateTime.hour > 2;
if (dateTime.date == endOfDst)
return dateTime.hour < 3;
return dateTime.date < endOfDst || dateTime.date > startOfDst;
}
} // namespace