Does this do what you want?

    SimpleTimeZone myZone = new SimpleTimeZone(-5*60*60*1000,"myZone");
    SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
    sdf.setTimeZone(myZone);
    Date d = sdf.parse("08/01/2002 12:00:00");
    System.out.println(sdf.format(d));

08/01/2002 12:00:00

Rich Hammer


Prashant Pai wrote:
The desired output is being able to parse that string.

so if I do

SimpleDateFormat sdf = new
SimpleDateFormat("MM/dd/yyyy HH:mm:ss z");

System.out.println(sdf.parse("08/01/2002 12:00:00
EST"));

Then I get "Thu Aug 01 13:00:00 EDT 2002"

What do I do to keep it in EST?

_______________________________________________
Juglist mailing list
[email protected]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to