Fixed time zone retrieval on Windows.
git-svn-id: http://yate.null.ro/svn/yate/trunk@5472 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
ab173307a5
commit
d7619ed087
|
@ -676,9 +676,12 @@ bool Time::toDateTime(unsigned int epochTimeSec, int& year, unsigned int& month,
|
|||
int Time::timeZone()
|
||||
{
|
||||
#ifdef _WINDOWS
|
||||
int diff = 0;
|
||||
_get_timezone(&diff);
|
||||
return -diff;
|
||||
struct tm t;
|
||||
time_t time = (time_t)secNow();
|
||||
_localtime_s(&t,&time);
|
||||
if (t.tm_isdst)
|
||||
return -(_timezone + _dstbias);
|
||||
return -_timezone;
|
||||
#else
|
||||
#ifdef HAVE_GMTOFF
|
||||
struct tm t;
|
||||
|
|
Loading…
Reference in New Issue