将时间毫秒转化为String类型,如00:00:00

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wdx_1136346879/article/details/52953842
/**
* 将时间毫秒转化为String类型,如00:00:00

* @param mili
*            时间毫秒
* @return 时间字符串,mili为0时,返回00:00:00
*/
public static String formatMiliLongToString(Long mili) {


if (0 == mili || null == mili) {


return "00:00:00";
}


Date date = new Date(mili);


SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");


format.setTimeZone(TimeZone.getTimeZone("UTC+8"));


return format.format(date);
}

猜你喜欢

转载自blog.csdn.net/wdx_1136346879/article/details/52953842
00
今日推荐