New java time zone info file is not supporting AEST/AEDT

5.5k views Asked by At

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

In above link of Oracle website they say that From version tzdata2014f, Java is supporting AEST/AEDT instead of EST for Australian timezone but I have current tzdata2014i version still it is not displaying EST only. Did I miss anything or is there anything do I need to do?

Here is small sample program 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 time zone datafile version

C:>java -jar tzupdater.jar -V tzupdater version 1.4.9-b01 JRE time zone data version: tzdata2014i Embedded time zone data version: tzdata2014i

Thanks in advance for any help.

Regards, BennY

1

There are 1 answers

0
Basil Bourque On

Your Question answers itself. As of tzdata2014f and later the A will be included:

Australian eastern time zone abbreviations are now AEST/AEDT not EST, and similarly for the other Australian zones. That is, for eastern standard and daylight saving time the abbreviations are AEST and AEDT instead of the former EST for both; similarly, ACST/ACDT, ACWST/ACWDT, and AWST/AWDT are now used instead of the former CST, CWST, and WST.

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

You say you are using tzdata2014i, which comes after tzdata2014f. So why are you confused about no longer seeing EST?

Time zone names

By the way, you should not be using these 3-4 letter abbreviations. They are not true time zones, not standardized, and not unique (as seen here with EST collision).

Instead use proper IANA time zone names in the format of continent/region. 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 about Time in Australia.