Browse Source

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.
dst
Christian Walther 13 years ago
parent
commit
59b04b546f
  1. 4
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp
  2. 2
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h

4
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

@ -263,9 +263,9 @@ void plUnifiedTime::ToCurrentTime()
SetToUTC(); 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; return false;
fSecs -= IGetLocalTimeZoneOffset(); fSecs -= IGetLocalTimeZoneOffset();

2
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.h

@ -129,7 +129,7 @@ public:
void SetSecsDouble(double secs); void SetSecsDouble(double secs);
void SetMicros(const UInt32 micros) { fMicros = micros; } void SetMicros(const UInt32 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 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(); hsBool SetToUTC();
void ToCurrentTime(); void ToCurrentTime();
void ToEpoch() { fSecs = 0; fMicros = 0;} void ToEpoch() { fSecs = 0; fMicros = 0;}

Loading…
Cancel
Save