I need some help from someone to let me know if I’m going insane. I can’t figure out if I’m missing something obvious or if this is a bug in the Java VM on Windows 2003. Take a look at this simple code:

import java.util.*;

public class test
{

    public static void main(String[] args)
    {
        String result = null;

        Calendar today =  Calendar.getInstance();

        System.out.println(today);
        System.out.println(today.getTime());
    }

}

This is as simple as I can boil down a test. Basically, what you should see is the date printing out twice, once in Calendar’s toString output (which outputs all its internals) and then once as a default time stamp.

I’ve run this code on Windows 2000, Mac OS X, and Windows Server 2003 (two boxes). For a system time of roughly 11 AM ET, I’m getting this for the simple timestamp (the Calendar output is too long, and is consistent with the timestamp):

Windows 2000:

Wed Mar 09 11:13:47 EST 2005

Mac OS X

Wed Mar 09 11:13:16 EST 2005

Windows Server 2003

Wed Mar 09 16:13:36 GMT 2005

WTF?! The two Windows 2003 boxes are in different time zones, one is set to PT and the other to ET. Both ignore the timezone settings and think they’re in GMT.

Any tips would be appreciated!

Update, before I even hit Publish: A coworker found a potential solution before I even got to post this. He used a completely different search term and found this page outlining a workaround. I’ve tested it in my particular case and it works perfectly. Thanks, Pat!