@@ -1307,6 +1307,15 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
1307
1307
Boolean result = false;
1308
1308
1309
1309
#if TARGET_OS_WIN32
1310
+ // Start by checking if we're just given a timezone Windows knows about
1311
+ int32_t offset ;
1312
+ __CFTimeZoneGetOffset (name , & offset );
1313
+ if (offset ) {
1314
+ // TODO: handle DST
1315
+ __CFTimeZoneInitFixed (timeZone , offset , name , 0 );
1316
+ return TRUE;
1317
+ }
1318
+
1310
1319
CFDictionaryRef abbrevs = CFTimeZoneCopyAbbreviationDictionary ();
1311
1320
1312
1321
tzName = CFDictionaryGetValue (abbrevs , name );
@@ -1319,9 +1328,8 @@ Boolean _CFTimeZoneInit(CFTimeZoneRef timeZone, CFStringRef name, CFDataRef data
1319
1328
CFRelease (abbrevs );
1320
1329
1321
1330
if (tzName ) {
1322
- int32_t offset ;
1323
1331
__CFTimeZoneGetOffset (tzName , & offset );
1324
- // TODO(compnerd) handle DST
1332
+ // TODO: handle DST
1325
1333
__CFTimeZoneInitFixed (timeZone , offset , name , 0 );
1326
1334
return TRUE;
1327
1335
}
@@ -1516,6 +1524,14 @@ CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef nam
1516
1524
CFURLRef baseURL = NULL ;
1517
1525
1518
1526
#if TARGET_OS_WIN32
1527
+ // Start by checking if we're just given a timezone Windows knows about
1528
+ int32_t offset ;
1529
+ __CFTimeZoneGetOffset (name , & offset );
1530
+ if (offset ) {
1531
+ // TODO: handle DST
1532
+ result = __CFTimeZoneCreateFixed (allocator , offset , name , 0 );
1533
+ }
1534
+
1519
1535
CFDictionaryRef abbrevs = CFTimeZoneCopyAbbreviationDictionary ();
1520
1536
1521
1537
tzName = CFDictionaryGetValue (abbrevs , name );
@@ -1528,9 +1544,8 @@ CFTimeZoneRef CFTimeZoneCreateWithName(CFAllocatorRef allocator, CFStringRef nam
1528
1544
CFRelease (abbrevs );
1529
1545
1530
1546
if (tzName ) {
1531
- int32_t offset ;
1532
1547
__CFTimeZoneGetOffset (tzName , & offset );
1533
- // TODO(compnerd) handle DST
1548
+ // TODO: handle DST
1534
1549
result = __CFTimeZoneCreateFixed (allocator , offset , name , 0 );
1535
1550
}
1536
1551
0 commit comments