X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftime%2Ftimezone.cpp;h=0ec9d2b8e4137300f3139bfb2f5661e7fe3a0764;hb=90d55c510f5dbd334be3a16017d1cf6ece61cf85;hp=9c146249208da8206ae6c1c937526afcde56fe21;hpb=b56eb5ec1da675da0c66abc53c1e4f6c4e4cccbd;p=libs%2Fcore.git diff --git a/source/time/timezone.cpp b/source/time/timezone.cpp index 9c14624..0ec9d2b 100644 --- a/source/time/timezone.cpp +++ b/source/time/timezone.cpp @@ -6,13 +6,12 @@ Distributed under the LGPL */ #include -#include -#include #ifdef WIN32 #include #else #include #endif +#include #include "../core/except.h" #include "timestamp.h" #include "timezone.h" @@ -102,7 +101,7 @@ TimeZone get_local_timezone() close(fd); if(gmtoff!=-1) - return TimeZone(-gmtoff/60, name); + return TimeZone(gmtoff/60, name); } return TimeZone(); #endif @@ -117,25 +116,23 @@ TimeZone::TimeZone(): name("UTC") { } -TimeZone::TimeZone(int minutes_west): - offset(minutes_west*min) +TimeZone::TimeZone(int minutes): + offset(minutes*min) { - if(minutes_west) + if(minutes) { - ostringstream ss; - ss.fill('0'); - int m = abs(minutes_west); - ss<<"UTC"<<(minutes_west<0 ? '-' : '+')<