fixed bug in wxDateTime::Set(jdn) when DST was in effect
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -108,6 +108,7 @@ All:
|
|||||||
|
|
||||||
- number of fixes to wxPluginManager (Rick Brice, Hans Van Leemputten)
|
- number of fixes to wxPluginManager (Rick Brice, Hans Van Leemputten)
|
||||||
- fixed memory leak in wxURL when using a proxy (Steven Van Ingelgem)
|
- fixed memory leak in wxURL when using a proxy (Steven Van Ingelgem)
|
||||||
|
- fixed bug in wxDateTime::Set(jdn) when DST was in effect
|
||||||
- it's now possible to use msgids in other languages than English with
|
- it's now possible to use msgids in other languages than English with
|
||||||
wxLocale (based on patch by Stefan Kowski)
|
wxLocale (based on patch by Stefan Kowski)
|
||||||
|
|
||||||
|
@@ -1287,6 +1287,17 @@ wxDateTime& wxDateTime::Set(double jdn)
|
|||||||
|
|
||||||
jdn *= MILLISECONDS_PER_DAY;
|
jdn *= MILLISECONDS_PER_DAY;
|
||||||
|
|
||||||
|
// JDNs always suppose an UTC date, so bring it back to local time zone
|
||||||
|
// (also see GetJulianDayNumber() implementation)
|
||||||
|
long tzDiff = GetTimeZone();
|
||||||
|
if ( IsDST() == 1 )
|
||||||
|
{
|
||||||
|
// FIXME: again, we suppose that DST is always one hour
|
||||||
|
tzDiff -= 3600;
|
||||||
|
}
|
||||||
|
|
||||||
|
jdn += tzDiff*1000; // tzDiff is in seconds
|
||||||
|
|
||||||
m_time.Assign(jdn);
|
m_time.Assign(jdn);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
@@ -1904,8 +1915,8 @@ wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday)
|
|||||||
|
|
||||||
double wxDateTime::GetJulianDayNumber() const
|
double wxDateTime::GetJulianDayNumber() const
|
||||||
{
|
{
|
||||||
// JDN are always expressed for the GMT dates
|
// JDN are always expressed for the UTC dates
|
||||||
Tm tm(ToTimezone(GMT0).GetTm(GMT0));
|
Tm tm(ToTimezone(UTC).GetTm(UTC));
|
||||||
|
|
||||||
double result = GetTruncatedJDN(tm.mday, tm.mon, tm.year);
|
double result = GetTruncatedJDN(tm.mday, tm.mon, tm.year);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user