i am trying to convert date and timestamp using .
public static void main(String args[]) {
list.add("2020-04-06T00:52:38+0000");
list.add("2020-04-06T24:52:38+0000");
list.add("2020-04-06T12:52:38+0000");
Date createdTime = null;
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ssZ");
try {
for (i =0; i < list.size(); i++) {
createdTime = df.parse(list.get(i));
System.out.print(i + " : " + "Media Created_on : " + createdTime + "\n");
}
} catch (ParseException e) {
e.printStackTrace();
}
}
Output :
0 : Media Created_on : Sun Apr 05 20:52:38 EDT 2020
1 : Media Created_on : Mon Apr 06 20:52:38 EDT 2020
2 : Media Created_on : Sun Apr 05 20:52:38 EDT 2020
Here it is converted from IST to EDT which is 4 hrs ahead. So for the last iteration, why it is 13 hrs difference for 12 hours?