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
This commit is contained in:
Vadim Zeitlin 2005-03-08 00:01:32 +00:00
parent 58385af016
commit 4f0436e465

View File

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