Why does Java return a date in GMT-4.5 when choosing Co-ordinated Universal Time time zone in Window
- by Simon Nickerson
We have seen a strange issue on some Windows XP machines involving the "Co-ordinated Universal Time" time zone. Not all Windows XP machines seem to have it, but on those that do, the following simple Java program
public class TimeTest {
public static void main(String[] args) {
System.out.println(java.util.TimeZone.getDefault());
System.out.println(new java.util.Date());
}
}
on JDK 1.6.0_06 prints:
sun.util.calendar.ZoneInfo[id="America/Caracas",offset=-16200000,dstSavings=0,useDaylight=false,transitions=5,lastRule=null]
Fri Nov 13 05:34:14 VET 2009
(i.e. 4 and a half hours behind GMT). I should add that I am based in London, and have never been to South America. :-)
My questions are:
Where does Java get this time zone from? I thought Co-ordinated Universal Time was supposed to be the new name for GMT.
Why do some Windows machines have this time zone but not others?