ICU-7229 getSystemTimeZoneInformation to set standardBias properly. For some reasons this change fixes the test failure reported in #7229 as well (I do not understand why...)
X-SVN-Rev: 26850
This commit is contained in:
parent
3cef7e25bb
commit
c41f24dee0
@ -43,6 +43,7 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY
|
||||
if (U_SUCCESS(status)) {
|
||||
if (std == NULL || dst == NULL) {
|
||||
bias = -1 * (initial->getRawOffset()/60000);
|
||||
standardBias = 0;
|
||||
daylightBias = 0;
|
||||
// Do not use DST. Set 0 to all stadardDate/daylightDate fields
|
||||
standardDate.wYear = standardDate.wMonth = standardDate.wDayOfWeek = standardDate.wDay =
|
||||
@ -54,6 +55,7 @@ static UBool getSystemTimeInformation(TimeZone *tz, SYSTEMTIME &daylightDate, SY
|
||||
U_ASSERT(dst->getRule()->getDateRuleType() == DateTimeRule::DOW);
|
||||
|
||||
bias = -1 * (std->getRawOffset()/60000);
|
||||
standardBias = 0;
|
||||
daylightBias = -1 * (dst->getDSTSavings()/60000);
|
||||
// Always use DOW type rule
|
||||
int32_t hour, min, sec, mil;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
********************************************************************************
|
||||
* Copyright (C) 2005-2008, International Business Machines
|
||||
* Copyright (C) 2005-2009, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
********************************************************************************
|
||||
*
|
||||
@ -76,7 +76,6 @@ void Win32DateTimeTest::testLocales(TestLog *log)
|
||||
const TimeZone *tz = TimeZone::createDefault();
|
||||
TIME_ZONE_INFORMATION tzi;
|
||||
|
||||
uprv_memset(&tzi, 0, sizeof(tzi));
|
||||
tz->getID(zoneID);
|
||||
if (! uprv_getWindowsTimeZoneInfo(&tzi, zoneID.getBuffer(), zoneID.length())) {
|
||||
UBool found = FALSE;
|
||||
@ -114,10 +113,10 @@ void Win32DateTimeTest::testLocales(TestLog *log)
|
||||
WCHAR longDateFormat[81], longTimeFormat[81], wdBuffer[256], wtBuffer[256];
|
||||
int32_t calType = 0;
|
||||
|
||||
// NULL localeID means ICU didn't recognize this locale
|
||||
if (lcidRecords[i].localeID == NULL) {
|
||||
continue;
|
||||
}
|
||||
// NULL localeID means ICU didn't recognize this locale
|
||||
if (lcidRecords[i].localeID == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
GetLocaleInfoW(lcidRecords[i].lcid, LOCALE_SLONGDATE, longDateFormat, 81);
|
||||
GetLocaleInfoW(lcidRecords[i].lcid, LOCALE_STIMEFORMAT, longTimeFormat, 81);
|
||||
|
Loading…
Reference in New Issue
Block a user