Name: sgC58550 Date: 06/06/97
Even though the local machine is configured for EDT, the
SimpleDateFormat class always seems to use PDT:
public class Testit
{
public static void main(String[] args)
{
SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy 'at' hh:mm:ss a zzz");
Date currentTime_1 = new Date();
String dateString = formatter.format(currentTime_1);
System.out.println("dateString is: " + dateString);
System.out.println("currentTime_1 is: " + currentTime_1);
} // End of method
} // End of class
The output produced by the above code is:
dateString is: 06/05/1997 at 08:14:35 AM PDT
currentTime_1 is: Thu Jun 05 11:14:35 EDT 1997
The formats should differ, but the date, time, and time zone
should be the same.
company - TRC , email -
======================================================================
- duplicates
-
JDK-4069784 TimeZone.getDefault() returns incorrect time zome.
-
- Closed
-
- relates to
-
JDK-4071776 The default TimeZone for DateFormat is PST
-
- Closed
-