New java timezone info file does not support AEST / AEDT

http://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html

The Oracle website link above says that since tzdata2014f version, Java supports AEST / AEDT instead of EST for the Australian time zone, but I have the current version of tzdata2014i, but it does not only display EST. Am I missing something or do I need to do something?

Here is a small program that I used,

import java.util.*; public class TZ { public static void main(String[] args) { System.out.println(System.getProperty("java.home")); for (String id : TimeZone.getAvailableIDs()) { if (!id.startsWith("Australia/")) continue; TimeZone tz = TimeZone.getTimeZone(id); System.out.println(id + ": " + "Daylight: False : " + tz.getDisplayName(false, TimeZone.SHORT) + "/" + " Daylight: True : "+ tz.getDisplayName(true, TimeZone.SHORT)); } } } 

And here is my version of the timezone file

C:> java -jar tzupdater.jar -V Version tzupdater 1.4.9-b01 Time zone data version JRE: tzdata2014i Built-in time zone data version: tzdata2014i

Thanks in advance for your help.

Regards, Benny

+5
source share
1 answer

Your question is answered by yourself. Starting with tzdata2014f and later A will be included:

Abbreviations for Australian Eastern Time Zones are now AEST / AEDT, not EST, as well as for other Australian zones. That is, for Eastern Standard and Daylight Saving Time, the abbreviations mean AEST and AEDT instead of the previous EST for both; similarly, ACST / ACDT, ACWST / ACWDT and AWST / AWDT are now used instead of the previous CST, CWST and WST.

This change does not affect UTC offsets, only time zone reductions.

You say you are using tzdata2014i, which appears after tzdata2014f. So why are you embarrassed that you no longer see EST ?

Time Zone Names

By the way, you should not use these 3-4 abbreviations. They are not real time zones, not standardized, and not unique (as seen here in the EST collision).

Instead, use the correct IANA time zone names in continent/region format. For example, Australia/Sydney .

 Instant instant = Instant.now(); ZoneId zoneId = ZoneId.of( "Australia/Sydney" ); ZonedDateTime zdt = instant.atZone( zoneId ); 

instant.toString (): 2016-09-29T22: 42: 40.063Z

now.toString (): 2016-09-30T08: 42: 40.063 + 10: 00 [Australia / Sydney]

FYI, Wikipedia has a page on Time in Australia .

0
source

Source: https://habr.com/ru/post/1208727/


All Articles