将秒数转化成天,小时,分,秒格式
/**
* @Description: 将秒转化为天,小时,分,秒
* @param: second 秒数
*/
public static String secondToDate(String second) {
Long time = Long.valueOf(second);
String strTime = null;
Long days = time / (60 * 60 * 24);
Long hours = (time % (60 * 60 * 24)) / (60 * 60);
Long minutes = (time % (60 * 60)) / 60;
Long seconds = time % 60;
if (days > 0) {
strTime = days + "天" + hours + "小时" + minutes + "分钟";
} else if (hours > 0) {
strTime = hours + "小时" + minutes + "分钟";
} else if (minutes > 0) {
strTime = minutes + "分钟" + seconds + "秒";
} else {
strTime = second + "秒";
}
return strTime;
}