`

  //根据秒获取时间格式   结果为 :  long i =  2591881;   29天23小时58分钟1秒
public static String formatDateTime(long mss) {
	String DateTimes = null;
	long days = mss / ( 60 * 60 * 24);
	long hours = (mss % ( 60 * 60 * 24)) / (60 * 60);
	long minutes = (mss % ( 60 * 60)) /60;
	long seconds = mss % 60;
	if(days>0){
		DateTimes= days + "天" + hours + "小时" + minutes + "分钟"
				+ seconds + "秒";
	}else if(hours>0){
		DateTimes=hours + "小时" + minutes + "分钟"
				+ seconds + "秒";
	}else if(minutes>0){
		DateTimes=minutes + "分钟"
				+ seconds + "秒";
	}else{
		DateTimes=seconds + "秒";
	}

	return DateTimes;
}
  `

相关文章:

  • 2022-12-23
  • 2021-12-28
  • 2021-09-29
  • 2022-12-23
  • 2021-07-28
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-11-28
  • 2021-11-19
  • 2022-12-23
  • 2021-12-18
相关资源
相似解决方案