I run a Java program on a Windows machine. I am trying to get a list of time zones and their related information. Here is the complete program:

    String[] allTimeZones = TimeZone.getAvailableIDs();
    Date now = new Date();
    for (int i = 0; i < allTimeZones.length; i++) {
        TimeZone tz = TimeZone.getTimeZone(allTimeZones[i]);
        System.out.format("%s;%s; %f \n", 
                          allTimeZones[i],
                          tz.getDisplayName(), 
                          (float) (tz.getOffset(now.getTime())/3600000.0));
    }

One of the generated time zone has the following info:

America/New_York;Eastern Standard Time; -4.000000

This is puzzling. At this moment, New York is in Eastern Summer Daylight Saving time. So the above info is not right.

Does anyone know how I can make Java to generate

America/New_York;Eastern Standard Time; -5.000000

or something like this

America/New_York;Eastern Summer Daylight Saving Time; -4.000000

Thanks for help!

Regards

Edit
Report