秒转时分秒

public static String secondsToTime(long seconds) {
		long h = 0;
		long d = 0;
		long s = 0;		
		long temp = seconds % 3600;
		if (seconds > 3600) {
			h = seconds / 3600;
			if (temp != 0) {
				if (temp > 60) {
					d = temp / 60;
					if (temp % 60 != 0) {
						s = temp % 60;
					}
				} else {
					s = temp;
				}
			}
		} else {
			d = seconds / 60;
			if (seconds % 60 != 0) {
				s = seconds % 60;
			}
		}
		return (h<10?"0"+h:h)+":"+(d<10?"0"+d:d)+":"+(s<10?"0"+s:s);  
	}
原文地址:https://www.cnblogs.com/tzp_8/p/2230416.html