Performing some operations using Java Date. Have the following code
public static void main(String[] args) {
String dateFormat="yyyy-MM-dd HH:mm:ss.SSS";
String d="1970-04-10 00:00:00.0";
Date parsingDate=null;
XMLGregorianCalendar xl=null;
SimpleDateFormat parser = new SimpleDateFormat(dateFormat);
parser.setTimeZone(TimeZone.getTimeZone("America/New_York"));
try {
parsingDate=parser.parse(d);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(parsingDate);
}
The output is Fri Apr 10 10:30:00 IST 1970.
Shouldn't this not be IST and be EST as follows Fri Apr 10 10:30:00 EST 1970.
Thanks