Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit caf72cf3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix incorrect GMT offset in display" into pi-dev

parents 00a2dcb8 77f97af8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ public class TimeZoneInfo {
        public TimeZoneInfo format(TimeZone timeZone) {
            final String id = timeZone.getID();
            final TimeZoneNames timeZoneNames = mTimeZoneFormat.getTimeZoneNames();
            final java.util.TimeZone javaTimeZone = android.icu.impl.TimeZoneAdapter.wrap(timeZone);
            final java.util.TimeZone javaTimeZone = java.util.TimeZone.getTimeZone(id);
            final CharSequence gmtOffset = ZoneGetter.getGmtOffsetText(mTimeZoneFormat, mLocale,
                javaTimeZone, mNow);
            return new TimeZoneInfo.Builder(timeZone)
+9 −0
Original line number Diff line number Diff line
@@ -43,4 +43,13 @@ public class TimeZoneInfoTest {
        assertThat(timeZoneInfo.getStandardName()).isEqualTo("Pacific Standard Time");
        assertThat(timeZoneInfo.getDaylightName()).isEqualTo("Pacific Daylight Time");
    }

    @Test
    public void getGmtOffset_zoneLordHowe_correctGmtOffset() {
        Date date = new Date(1514764800000L); // 00:00 1/1/2018 GMT
        Formatter formatter = new Formatter(Locale.US, date);

        TimeZoneInfo timeZoneInfo = formatter.format("Australia/Lord_Howe");
        assertThat(timeZoneInfo.getGmtOffset().toString()).isEqualTo("GMT+11:00");
    }
}