X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2747a51b243ef5d44cec5b4e3757d56af56352a2..cc4d5638c66a409e421420ed7110917755a66788:/src/common/datetimefmt.cpp diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 0868f626aa..4855025050 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 11.05.99 -// RCS-ID: $Id$ // Copyright: (c) 1999 Vadim Zeitlin // parts of code taken from sndcal library by Scott E. Lee: // @@ -655,6 +654,18 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const case wxT('z'): // time zone as [-+]HHMM { int ofs = tz.GetOffset(); + + // The time zone offset does not include the DST, but + // we do need to take it into account when showing the + // time in the local time zone to the user. + if ( ofs == -wxGetTimeZone() && IsDST() == 1 ) + { + // FIXME: As elsewhere in wxDateTime, we assume + // that the DST is always 1 hour, but this is not + // true in general. + ofs += 3600; + } + if ( ofs < 0 ) { res += '-';