/**
* 把毫秒数转换成时分秒
* @param millis
* @return
*/
public StringmillisToStringShort(long millis) {
StringBuffer strBuilder =new StringBuffer();
long temp = millis;
long hper =60 *60 *1000;
long mper =60 *1000;
long sper =1000;
if (temp / hper >0) {
strBuilder.append(temp / hper).append("小时");
}
temp = temp % hper;
if (temp / mper >0) {
strBuilder.append(temp / mper).append("分钟");
}
temp = temp % mper;
if (temp / sper >0) {
strBuilder.append(temp / sper).append("秒");
}
return strBuilder.toString();
}
网友评论