The reason is because of the time zone problem
. The solution is to execute the setTimeZone method of SimpleDateFormat
SimpleDateFormat hms = new SimpleDateFormat("HH:mm:ss");
hms.setTimeZone(TimeZone.getTimeZone("GMT"));
Date tTime = new Date(l);//跑步用时
String totalTime = hms.format(tTime);
//totalTime得到时分秒