Why does Java return a date in GMT-4.5 when choosing Co-ordinated Universal Time time zone in Window

Posted by Simon Nickerson on Stack Overflow See other posts from Stack Overflow or by Simon Nickerson
Published on 2009-11-13T09:55:27Z Indexed on 2010/04/23 20:13 UTC
Read the original article Hit count: 197

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about Windows