I made this snippet to show my problem:
import java.text.SimpleDateFormat;
public class Foo {
public static void main(String[] args) {
SimpleDateFormat formatter = new SimpleDateFormat("mm hh dd MM yyyy");
String date1 = "1412293500";
String date2 = "1412336700";
String dateString1 = formatter.format(Long.parseLong(date1 + "000"));
String dateString2 = formatter.format(Long.parseLong(date2 + "000"));
System.out.println(dateString1 + " " + dateString2);
}
}
date1
and date2
are expressed in seconds, so I'm expecting two different dates in output, but the dates are printed the same. I checked inside this online tool, and as you can see the dates are related to two different days.
How can I solve this?