I get wrong time zone name for specific historical dates with negative DST offset.
Update in Time Zone database (tzdata) introduced negative DST for zone Europe/Prague in period from 1946-12-01 to 1947-02-23.
This is the source of tzdata for Europe/Prague:
# We know of no English-language name for historical Czech winter time;
# abbreviate it as "GMT", as it happened to be GMT.
...
1:00 Czech CE%sT 1946 Dec 1 3:00
# Vanguard section, for zic and other parsers that support negative DST.
1:00 -1:00 GMT 1947 Feb 23 2:00
# Rearguard section, for parsers that do not support negative DST.
# 0:00 - GMT 1947 Feb 23 2:00
This new database is in Java 8 since u181.
When use time in specified period I get wrong time zone name as "CET" / "Central European Time" instead of GMT as is stated in tzdata.
Long timeInMilis = Long.parseLong("-725328000000");
String pattern = "yyyy-MM-dd HH:mm:ss zzz";
TimeZone.setDefault(TimeZone.getTimeZone(("Europe/Berlin")));
System.out.println(new SimpleDateFormat(pattern).format(new Date(timeInMilis)));
TimeZone.setDefault(TimeZone.getTimeZone(("Europe/Prague")));
System.out.println(new SimpleDateFormat(pattern).format(new Date(timeInMilis)));
Result is
1947-01-07 01:00:00 CET
1947-01-07 00:00:00 CET
First row is for Berlin time zone, second for Prague. Both says it's CET, but for Prague it is wrong. It should say GMT as is mentioned in Time Zone Database
java.timeclasses. - RealSkepticLong.parseLong("-725328000000")should be written as just-725328000000L. - VGR725_328_000_000L(also @VGR) - Ole V.V.TimeZone,SimpleDateFormatandDate. Those classes are poorly designed and long outdated,SimpleDateFormatin particular notoriously troublesome. Instead useInstant,ZoneId,ZonedDateTimeandDateTimeFormatter, all from java.time, the modern Java date and time API. - Ole V.V.