# java YST9YDT time zone problem

**URL:** <https://discussions.flightaware.com/t/java-yst9ydt-time-zone-problem/5688>\
**Category:** AeroAPI\
**Created:** [July 1, 2008, 12:29pm UTC](https://discussions.flightaware.com/t/java-yst9ydt-time-zone-problem/5688 "2008-07-01T12:29:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vista](https://avatars.discourse-cdn.com/v4/letter/v/8e7dd6/32.png) [@vista](https://discussions.flightaware.com/u/vista)\
**Post date:** [July 1, 2008, 12:29pm UTC](https://discussions.flightaware.com/t/java-yst9ydt-time-zone-problem/5688/1 "2008-07-01T12:29:22Z")

</div>

members,  
The timezone i get from Anchorage AK (PANC) is YST9YDT.  
When i set this time zone to a calendar object in java and print it out,  
the zone info shows GMT instead of the set time zone.

Later when i try to print all the available time zones using java,  
i can find only SystemV/YST9YDT and no “YST9YDT” i think this is creating the problem.  
Java expects “SystemV/YST9YDT” while flightXML give just “YST9YDT” and all my flight time info is all messed up.  
when i set “SystemV/YST9YDT” as the time zone, it prints out correct.  
is this a java only problem. Anyone else faced this.

Regards  
krishna.

The code snippet ---------------

Calendar cal = Calendar.getInstance();  
// prints the calendar obj with the local time zone as default  
System.out.println(cal);

// calendar obj with the new time zone  
TimeZone tz = TimeZone.getTimeZone(“YST9YDT”);  
cal.setTimeZone(tz);  
System.out.println(cal);

// calendar obj with the new time zone systemv prefix  
tz = TimeZone.getTimeZone(“SystemV/YST9YDT”);  
cal.setTimeZone(tz);  
System.out.println(cal);

The result ----------------------

## java.util.GregorianCalendar[time=1214914093051,areFieldsSet=true,areAllFieldsSet =true,lenient=true,zone=sun.util.calendar.ZoneInfo[id=“Asia/Calcutta”,offset=198 00000,dstSavings=0,useDaylight=false, – blah blah –

## java.util.GregorianCalendar[time=1214914093051,areFieldsSet=false,areAllFieldsSe t=false,lenient=true,zone=sun.util.calendar.**ZoneInfo[id=“GMT”**,offset=0,dstSaving s=0,useDaylight=false,-- blah blah –

java.util.GregorianCalendartime=1214914714926,areFieldsSet=false,areAllFieldsSe  
t=false,lenient=true,zone=sun.util.calendar.ZoneInfoid=“SystemV/YST9YDT”,offset  
=-32400000,dstSavings=3600000,useDaylight=true,transitions=276,lastRule=java.uti
