Hello team,
According to the latest 2020a tz update: Canada's Yukon, represented by America/Whitehorse and
America/Dawson, advanced to -07 year-round, beginning with its
spring-forward transition on 2020-03-08, and will not fall back on
2020-11-01.
We have written a test cases like below for canada yukon timezone. We imported new 2020a tz into our environment.
Our code seems correct but test cases are failing. So we found that there is wrong in Iana tz side.
Please check and correct us. This is the below code we have written.
@Test
public void doesNotFallBackToMinus8InDawsonNovember2020() {
DateTimeZone timezone = DateTimeZone.forID("America/Dawson");
Instant dayAfter = new DateTime(2020, 11, 2, 0, 0, timezone)-------> on 2nd nov 00:00:00
.withLaterOffsetAtOverlap()
.toInstant();
Instant day = new DateTime(2020, 11, 1, 0, 0, timezone)------> on 1 st nov 00:00:00
.withLaterOffsetAtOverlap()
.toInstant();
long dayAfterOffset = timezone.getOffset(dayAfter.getMillis());
int dayAfterHours = (int) TimeUnit.MILLISECONDS.toHours(dayAfterOffset);
long offsetOnDay = timezone.getOffset(day.getMillis());
int hoursOnDay = (int) TimeUnit.MILLISECONDS.toHours(offsetOnDay);
assertEquals(hoursOnDay, dayAfterHours); -------> here we are getting error: java.lang.AssertionError: expected:<-7> but was:<-8>
}
The above test case according to your update (will not fall back on 2020-11-01) is correct. But test case is failing.
Could you please clarify us that is there anything wrong from IANA tz.
If not how can i write my test case according to that?
Regards,
Sundar