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
This commit is contained in:
Evileye
2018-10-31 23:16:03 +01:00
committed by Vadim Zeitlin
parent 394b26bc36
commit 28f7e6130d
2 changed files with 2 additions and 6 deletions

View File

@@ -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