@@ -18,13 +18,15 @@ public static class TimeZoneInfoTests
18
18
private static String s_strAmsterdam = s_isWindows ? "W. Europe Standard Time" : "Europe/Berlin" ;
19
19
private static String s_strRussian = s_isWindows ? "Russian Standard Time" : "Europe/Moscow" ;
20
20
private static String s_strLibya = s_isWindows ? "Libya Standard Time" : "Africa/Tripoli" ;
21
+ private static String s_strCatamarca = s_isWindows ? "Argentina Standard Time" : "America/Catamarca" ;
21
22
22
23
private static TimeZoneInfo s_myUtc = TimeZoneInfo . Utc ;
23
24
private static TimeZoneInfo s_myLocal = TimeZoneInfo . Local ;
24
25
private static TimeZoneInfo s_regLocal = TimeZoneInfo . FindSystemTimeZoneById ( TimeZoneInfo . Local . Id ) ; // in case DST is disabled on Local
25
26
private static TimeZoneInfo s_GMTLondon = TimeZoneInfo . FindSystemTimeZoneById ( s_strGMT ) ;
26
27
private static TimeZoneInfo s_nairobiTz = TimeZoneInfo . FindSystemTimeZoneById ( s_strNairobi ) ;
27
28
private static TimeZoneInfo s_amsterdamTz = TimeZoneInfo . FindSystemTimeZoneById ( s_strAmsterdam ) ;
29
+ private static TimeZoneInfo s_catamarcaTz = TimeZoneInfo . FindSystemTimeZoneById ( s_strCatamarca ) ;
28
30
29
31
private static bool s_localIsPST = TimeZoneInfo . Local . Id == s_strPacific ;
30
32
private static bool s_regLocalSupportsDST = s_regLocal . SupportsDaylightSavingTime ;
@@ -159,7 +161,7 @@ public static void NearMinMaxDateTimeOffsetConvertTest()
159
161
VerifyConvert ( new DateTimeOffset ( DateTime . MinValue . AddHours ( 5 ) , new TimeSpan ( - 3 , 0 , 0 ) ) , s_strPacific , new DateTimeOffset ( DateTime . MinValue , new TimeSpan ( - 8 , 0 , 0 ) ) ) ;
160
162
161
163
VerifyConvert ( DateTime . MaxValue , s_strPacific , s_strSydney , DateTime . MaxValue ) ;
162
- VerifyConvert ( DateTime . MaxValue . AddHours ( - 19 ) , s_strPacific , s_strSydney , DateTime . MaxValue ) ;
164
+ VerifyConvert ( DateTime . MaxValue . AddHours ( - 19 ) , s_strPacific , s_strSydney , DateTime . MaxValue ) ;
163
165
VerifyConvert ( DateTime . MaxValue . AddHours ( - 19.5 ) , s_strPacific , s_strSydney , DateTime . MaxValue . AddHours ( - 0.5 ) ) ;
164
166
165
167
VerifyConvert ( DateTime . MinValue , s_strSydney , s_strPacific , DateTime . MinValue ) ;
@@ -335,10 +337,10 @@ public static void NearMinMaxDateTimeConvertTest()
335
337
336
338
if ( Interop . IsWindows )
337
339
{
338
- VerifyConvert ( utcMinValue . AddHours ( 8 ) , s_strPacific , DateTime . MinValue ) ;
339
- VerifyConvert ( utcMinValue . AddHours ( 8.5 ) , s_strPacific , DateTime . MinValue . AddHours ( 0.5 ) ) ;
340
- VerifyConvert ( utcMinValue , s_strSydney , DateTime . MinValue . AddHours ( 11 ) ) ;
341
- }
340
+ VerifyConvert ( utcMinValue . AddHours ( 8 ) , s_strPacific , DateTime . MinValue ) ;
341
+ VerifyConvert ( utcMinValue . AddHours ( 8.5 ) , s_strPacific , DateTime . MinValue . AddHours ( 0.5 ) ) ;
342
+ VerifyConvert ( utcMinValue , s_strSydney , DateTime . MinValue . AddHours ( 11 ) ) ;
343
+ }
342
344
else
343
345
{
344
346
// for early times, IANA uses local mean time (LMT), which is based on the solar time.
@@ -447,7 +449,7 @@ public static void PerthRulesTest()
447
449
{
448
450
// ambiguous time between rules
449
451
// this is not ideal, but the way it works
450
- VerifyConvert ( time1utc , s_strPerth , time1 . AddHours ( 8 ) ) ;
452
+ VerifyConvert ( time1utc , s_strPerth , time1 . AddHours ( 8 ) ) ;
451
453
}
452
454
else
453
455
{
@@ -1655,6 +1657,29 @@ public static void InvalidTimeTests()
1655
1657
VerifyInv ( s_amsterdamTz , new DateTime ( 2006 , 12 , 15 , 12 , 15 , 44 ) , false ) ;
1656
1658
}
1657
1659
1660
+ [ Fact ]
1661
+ [ PlatformSpecific ( PlatformID . AnyUnix ) ]
1662
+ public static void TestCatamarcaMultiYearDaylightSavings ( )
1663
+ {
1664
+ // America/Catamarca had DST from
1665
+ // 1946-10-01T04:00:00.0000000Z {-03:00:00 DST=True}
1666
+ // 1963-10-01T03:00:00.0000000Z {-04:00:00 DST=False}
1667
+
1668
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1946 , 09 , 30 , 17 , 00 , 00 , DateTimeKind . Utc ) , false ) ;
1669
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1946 , 10 , 01 , 03 , 00 , 00 , DateTimeKind . Utc ) , false ) ;
1670
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1946 , 10 , 01 , 03 , 59 , 00 , DateTimeKind . Utc ) , false ) ;
1671
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1946 , 10 , 01 , 04 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1672
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1950 , 01 , 01 , 00 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1673
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1953 , 03 , 01 , 15 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1674
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1955 , 05 , 01 , 16 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1675
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1957 , 07 , 01 , 17 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1676
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1959 , 09 , 01 , 00 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1677
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1961 , 11 , 01 , 00 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1678
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1963 , 10 , 01 , 02 , 00 , 00 , DateTimeKind . Utc ) , true ) ;
1679
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1963 , 10 , 01 , 02 , 59 , 00 , DateTimeKind . Utc ) , true ) ;
1680
+ VerifyDST ( s_catamarcaTz , new DateTime ( 1963 , 10 , 01 , 03 , 00 , 00 , DateTimeKind . Utc ) , false ) ;
1681
+ }
1682
+
1658
1683
//
1659
1684
// Helper Methods
1660
1685
//
0 commit comments