From 7e63b2d3ffadbcf33e9e0b823186969c175f9005 Mon Sep 17 00:00:00 2001 From: Hokwon Song Date: Wed, 28 Aug 2013 10:56:48 +0900 Subject: [PATCH] Update historical dst offset for timezone. Change-Id: Ib60e43ae6272e6bdad589413112f3ee180bb28c1 Signed-off-by: Hokwon Song --- src/locales/FLcl_TimeZoneImpl.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/locales/FLcl_TimeZoneImpl.cpp b/src/locales/FLcl_TimeZoneImpl.cpp index e4b3c45..915e23a 100644 --- a/src/locales/FLcl_TimeZoneImpl.cpp +++ b/src/locales/FLcl_TimeZoneImpl.cpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include @@ -142,6 +144,29 @@ _TimeZoneImpl::_TimeZoneImpl(U_ICU_NAMESPACE::TimeZone* pIcuTimeZone, UDate icuD __dstSaving = pIcuTz->getDSTSavings() / ONE_MIN_IN_MILLISEC; } } + else + { + U_ICU_NAMESPACE::TimeZoneTransition transition; + bool result = pIcuTz->getPreviousTransition(icuDate, true, transition); + if (result) + { + const U_ICU_NAMESPACE::TimeZoneRule* pTzFromRule = transition.getFrom(); + const U_ICU_NAMESPACE::TimeZoneRule* pTzToRule = transition.getTo(); + + if (pTzFromRule->getDSTSavings()) + { + __dstSaving = pTzFromRule->getDSTSavings() / ONE_MIN_IN_MILLISEC; + } + else if (pTzToRule->getDSTSavings()) + { + __dstSaving = pTzToRule->getDSTSavings() / ONE_MIN_IN_MILLISEC; + } + else //if (pTzFromRule->getDSTSavings() == 0 && pTzToRule->getDSTSavings() == 0) + { + __dstSaving = 0; + } + } + } delete pInitial; delete pStd; delete pDst; -- 2.7.4