Android long transfer time, 8 hours more solution

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得到时分秒

Guess you like

Origin blog.csdn.net/sinat_35541927/article/details/53007157