Diffstat (limited to 'libopie2/opiepim/core/opimtimezone.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimtimezone.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libopie2/opiepim/core/opimtimezone.cpp b/libopie2/opiepim/core/opimtimezone.cpp index fefceb5..5b32b1f 100644 --- a/libopie2/opiepim/core/opimtimezone.cpp +++ b/libopie2/opiepim/core/opimtimezone.cpp | |||
@@ -48,6 +48,7 @@ QDateTime utcTime( time_t t ) | |||
48 | ret.setTime( QTime( broken->tm_hour, broken->tm_min, broken->tm_sec ) ); | 48 | ret.setTime( QTime( broken->tm_hour, broken->tm_min, broken->tm_sec ) ); |
49 | return ret; | 49 | return ret; |
50 | } | 50 | } |
51 | |||
51 | QDateTime utcTime( time_t t, const QString& zone ) | 52 | QDateTime utcTime( time_t t, const QString& zone ) |
52 | { | 53 | { |
53 | QCString org = ::getenv( "TZ" ); | 54 | QCString org = ::getenv( "TZ" ); |
@@ -70,6 +71,8 @@ QDateTime utcTime( time_t t, const QString& zone ) | |||
70 | 71 | ||
71 | return ret; | 72 | return ret; |
72 | } | 73 | } |
74 | |||
75 | |||
73 | time_t to_Time_t( const QDateTime& utc, const QString& str ) | 76 | time_t to_Time_t( const QDateTime& utc, const QString& str ) |
74 | { | 77 | { |
75 | QDate d = utc.date(); | 78 | QDate d = utc.date(); |
@@ -151,9 +154,8 @@ QDateTime OPimTimeZone::toDateTime( time_t t ) | |||
151 | */ | 154 | */ |
152 | QDateTime OPimTimeZone::toDateTime( const QDateTime& dt, const OPimTimeZone& zone ) | 155 | QDateTime OPimTimeZone::toDateTime( const QDateTime& dt, const OPimTimeZone& zone ) |
153 | { | 156 | { |
154 | time_t utc = to_Time_t( dt, zone.m_name ); | 157 | time_t utc = to_Time_t( dt, m_name ); |
155 | owarn << "" << utc << " " << zone.m_name << "" << oendl; | 158 | return utcTime( utc, zone.m_name ); |
156 | return utcTime( utc, m_name ); | ||
157 | } | 159 | } |
158 | 160 | ||
159 | 161 | ||
@@ -165,7 +167,7 @@ time_t OPimTimeZone::fromDateTime( const QDateTime& time ) | |||
165 | 167 | ||
166 | time_t OPimTimeZone::fromUTCDateTime( const QDateTime& time ) | 168 | time_t OPimTimeZone::fromUTCDateTime( const QDateTime& time ) |
167 | { | 169 | { |
168 | return to_Time_t( time, "UTC" ); | 170 | return to_Time_t( time, "Europe/London" ); |
169 | } | 171 | } |
170 | 172 | ||
171 | 173 | ||
@@ -179,7 +181,7 @@ OPimTimeZone OPimTimeZone::current() | |||
179 | 181 | ||
180 | OPimTimeZone OPimTimeZone::utc() | 182 | OPimTimeZone OPimTimeZone::utc() |
181 | { | 183 | { |
182 | return OPimTimeZone( "UTC" ); | 184 | return OPimTimeZone( "Europe/London" ); |
183 | } | 185 | } |
184 | 186 | ||
185 | 187 | ||