From 595d2659ca25cf13dcab8000f07083ffd5ae29d6 Mon Sep 17 00:00:00 2001 From: Christian Walther Date: Fri, 30 Mar 2012 21:48:37 +0200 Subject: [PATCH] Fix plUnifiedTime::SetGMTime The default value of the "dst" argument must be 0, because -1 leads to incorrect results when the given time falls into local DST. However, a "dst" argument makes no sense on a method that deals with GMT anyway, so remove it entirely. --- Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp index 67074d12..c7d1a08e 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp @@ -257,9 +257,9 @@ void plUnifiedTime::ToCurrentTime() SetToUTC(); } -hsBool plUnifiedTime::SetGMTime(short year, short month, short day, short hour, short minute, short second, unsigned long usec, int dst) +hsBool plUnifiedTime::SetGMTime(short year, short month, short day, short hour, short minute, short second, unsigned long usec) { - if( !SetTime( year, month, day, hour, minute, second, usec, dst ) ) + if( !SetTime( year, month, day, hour, minute, second, usec, 0 ) ) return false; fSecs -= IGetLocalTimeZoneOffset(); diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h index 6a8e25db..cec65e9b 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h @@ -128,7 +128,7 @@ public: void SetSecsDouble(double secs); void SetMicros(const uint32_t micros) { fMicros = micros; } hsBool SetTime(short year, short month, short day, short hour, short minute, short second, unsigned long usec=0, int dst=-1); - hsBool SetGMTime(short year, short month, short day, short hour, short minute, short second, unsigned long usec=0, int dst=-1); + hsBool SetGMTime(short year, short month, short day, short hour, short minute, short second, unsigned long usec=0); hsBool SetToUTC(); void ToCurrentTime(); void ToEpoch() { fSecs = 0; fMicros = 0;}