From cb1ef83399add5c5fecc729a2a57d715f0601f97 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 21 Jan 2005 01:21:35 +0000 Subject: [PATCH] use ResetTime() in Today() instead of dealing with raw struct tm which introduces a bug around DST changes (replaces patch 1097811) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31524 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/datetime.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/wx/datetime.h b/include/wx/datetime.h index bf85baa01b..c40a90ee8c 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -1400,12 +1400,10 @@ inline wxDateTime wxDateTime::Now() /* static */ inline wxDateTime wxDateTime::Today() { - struct tm *time = GetTmNow(); - time->tm_hour = 0; - time->tm_min = 0; - time->tm_sec = 0; + wxDateTime dt(Now()); + dt.ResetTime(); - return wxDateTime(*time); + return dt; } #if (!(defined(__VISAGECPP__) && __IBMCPP__ >= 400)) -- 2.47.2