An epoch time is a count of seconds since epoch. You are dividing it by one thousand, gettings the number of thousands of seconds, that is, kiloseconds. But the parameter that Date
takes is in milliseconds. Your code should be:
long someTime = 1382364283;
long sTime = someTime*1000; // multiply by 1000, not divide
Date date = new Date(sTime);
DateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String formatted = format.format(date);
System.out.println(formatted); // 21/10/2013 10:04:43
I don't get exactly your result, but I get the same results as online converters I tried.