2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

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.
This commit is contained in:
Christian Walther
2012-03-30 21:48:37 +02:00
parent ec4190e807
commit 595d2659ca
2 changed files with 3 additions and 3 deletions

View File

@ -257,9 +257,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();

View File

@ -128,7 +128,7 @@ public:
void SetSecsDouble(double secs); void SetSecsDouble(double secs);
void SetMicros(const uint32_t micros) { fMicros = micros; } 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 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;}