From 52385567b7b9ace9b5a651a158f88b8adbabe2e6 Mon Sep 17 00:00:00 2001 From: Hokwon Song Date: Thu, 23 May 2013 13:36:41 +0900 Subject: [PATCH] Apply the dst rule for the system timezone. Change-Id: I2ee54f41d8c10edf8c7a1048c1c60174f71cddd5 Signed-off-by: Hokwon Song --- src/locales/FLcl_LocaleManagerImpl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/locales/FLcl_LocaleManagerImpl.cpp b/src/locales/FLcl_LocaleManagerImpl.cpp index 4155f28..52c4aa6 100644 --- a/src/locales/FLcl_LocaleManagerImpl.cpp +++ b/src/locales/FLcl_LocaleManagerImpl.cpp @@ -20,6 +20,7 @@ */ #include #include +#include #include #include #include @@ -638,8 +639,16 @@ _LocaleManagerImpl::GetSystemTimeZone(void) String tzId(tz + 20); SysLog(NID_LCL, "System TimeZone id [%ls]", tzId.GetPointer()); + TimeZone timeZone; - result r = Tizen::Locales::TimeZone::GetTimeZone(tzId, timeZone); + DateTime utcTime; + struct tm* pGmTime = null; + time_t currTime = 0; + time(&currTime); + pGmTime = gmtime(&currTime); + utcTime.SetValue(pGmTime->tm_year + 1900, pGmTime->tm_mon + 1, pGmTime->tm_mday, pGmTime->tm_hour, pGmTime->tm_min, pGmTime->tm_sec); + + result r = Tizen::Locales::TimeZone::GetTimeZone(tzId, utcTime, timeZone); SysTryReturn(NID_LCL, r == E_SUCCESS, TimeZone(-1, ""), r, "[%s] error occurs.", GetErrorMessage(r)); return timeZone; } -- 2.7.4