From 28f7e6130d484b4f615cebd00ff232f639113941 Mon Sep 17 00:00:00 2001 From: Evileye Date: Wed, 31 Oct 2018 23:16:03 +0100 Subject: [PATCH] Fix wxDateTime::ParseFormat() when matching TZ offset and in DST Don't skip MakeFromTimeZone() for the current time zone, this is still necessary. Fixes a failure in the unit tests when running during a DST period with TZ=Europe/London, for example. Closes https://github.com/wxWidgets/wxWidgets/pull/966 --- docs/changes.txt | 1 + src/common/datetimefmt.cpp | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index f35cb268d6..672b4d6b85 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -106,6 +106,7 @@ All: - Fix problem with wx-config installation and use under NetBSD (wiz). - Avoid spurious errors on thread creation under NetBSD. - Improve high DPI support in wxAui (Simon Rozman). +- Fix a bug with parsing time zones in wxDateTime::ParseFormat() (evileye). All (GUI): diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 721a149da0..d1454c28d1 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -1647,12 +1647,7 @@ wxDateTime::ParseFormat(const wxString& date, Set(tm); - // If a time zone was specified and it is not the local time zone, we need - // to shift the time accordingly. - // - // Note that avoiding the call to MakeFromTimeZone is necessary to avoid - // DST problems. - if ( haveTimeZone && timeZone != -wxGetTimeZone() ) + if ( haveTimeZone ) MakeFromTimezone(timeZone); // finally check that the week day is consistent -- if we had it