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:
marian 2013-04-18 12:11:38 +00:00
parent ab173307a5
commit d7619ed087
1 changed files with 6 additions and 3 deletions

View File

@ -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;