I want to convert the second/milliseconds in this format \"HH:mm:ss\" (for esamples, from 5 seconds to 00:00:05). I tried to get that format in this way:
int mil
You should get SimpleDateFormat with Locale argument.
public static String getDateFromMillis(long millis) { SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss", Locale.getDefault()); return formatter.format(new Date(millis)); }