From 4f0436e4655b628b32c4e9b27837c400e46c3746 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 8 Mar 2005 00:01:32 +0000 Subject: [PATCH] fixed bug in Set(double jdn): don't test whether the date is valid before setting it (closes 1158535) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/datetime.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 2a28895579..84cc559e76 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1386,6 +1386,8 @@ wxDateTime& wxDateTime::Set(double jdn) jdn *= MILLISECONDS_PER_DAY; + m_time.Assign(jdn); + // JDNs always suppose an UTC date, so bring it back to local time zone // (also see GetJulianDayNumber() implementation) long tzDiff = GetTimeZone(); @@ -1395,9 +1397,7 @@ wxDateTime& wxDateTime::Set(double jdn) tzDiff -= 3600; } - jdn += tzDiff*1000; // tzDiff is in seconds - - m_time.Assign(jdn); + m_time += tzDiff*1000; // tzDiff is in seconds return *this; } -- 2.50.0