From ff1e36afc063262750da38ca866784645be13520 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 22 Nov 2010 16:18:47 +0000 Subject: [PATCH 1/1] Initialize time zone information before using it in wxGetTimeZone(). We must call _tzset() before calling _get_timezone() as while this is normally done implicitly by the other time functions, it might not have been done yet if create a wxDateTime::TimeZone before calling any of them. Closes #12700. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 20b8e78240..2d60ee2d98 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -142,6 +142,10 @@ wxCUSTOM_TYPE_INFO(wxDateTime, wxToStringConverter , wxFromStringCon // deprecated and _get_timezone() should be used instead. static long wxGetTimeZone() { + // We must initialize the time zone information before using it + // (this will be done only once internally). + _tzset(); + long t; _get_timezone(&t); return t; -- 2.45.2