From 9cc311d32c3eeca78030e3c45d7829f1059befcc Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin <vadim@wxwidgets.org> Date: Mon, 31 Jan 2005 01:39:54 +0000 Subject: [PATCH] fixed bug in Set() on DST days (patch 1097811) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 9a2476991c..a2268b6243 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1213,6 +1213,12 @@ wxDateTime& wxDateTime::Set(wxDateTime_t hour, tm->tm_min = minute; tm->tm_sec = second; + // and the DST in case it changes on this date + struct tm tm2(*tm); + mktime(&tm2); + if ( tm2.tm_isdst != tm->tm_isdst ) + tm->tm_isdst = tm2.tm_isdst; + (void)Set(*tm); // and finally adjust milliseconds -- 2.47.2