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()
|
int Time::timeZone()
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
int diff = 0;
|
struct tm t;
|
||||||
_get_timezone(&diff);
|
time_t time = (time_t)secNow();
|
||||||
return -diff;
|
_localtime_s(&t,&time);
|
||||||
|
if (t.tm_isdst)
|
||||||
|
return -(_timezone + _dstbias);
|
||||||
|
return -_timezone;
|
||||||
#else
|
#else
|
||||||
#ifdef HAVE_GMTOFF
|
#ifdef HAVE_GMTOFF
|
||||||
struct tm t;
|
struct tm t;
|
||||||
|
|
Loading…
Reference in New Issue