JDK-4057161 : SimpleDateFormat.format() always shows time and time zones as PDT
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 1.1.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1997-06-06
  • Updated: 1997-10-23
  • Resolved: 1997-10-23
Related Reports
Duplicate :  
Relates :  
Description

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 - 
======================================================================

Comments
WORK AROUND Name: sgC58550 Date: 06/06/97 ======================================================================
11-06-2004