AnsweredAssumed Answered

How can I have a datetime value of 11/01/2011 12:00 which is GMT get converted to 11/01/2011 08:00 which is EDT?

Question asked by deepak.agrawal on Oct 13, 2011
Latest reply on Oct 18, 2011 by mike_aronson
Currently I have implemented this but it does not automatically take care of Daylight savings around the year.

import java.util.*;
import java.text.*;
if (applicationSubmittedDate != "") {
DateFormat inDF = new SimpleDateFormat("MM/dd/yyyy HH:mm");  
inDF.setTimeZone(TimeZone.getTimeZone( "GMT" ));  
Date aDate = inDF.parse(applicationSubmittedDate);  
DateFormat outDF = new SimpleDateFormat("MM/dd/yyyy HH:mm");  
outDF.setTimeZone(TimeZone.getTimeZone("EDT"));  // This is Deprecated.  
transformedDate = outDF.format(aDate);