/**
* 计算时间差
* @param begin
* @param end
* @return 返回格式,"hh:mm:ss"
*/
public String getTimeDifference(Date begin,Date end) {
long between=(end.getTime()-begin.getTime())/1000;
//除以1000是为了转换成秒
long hour=between%(24*3600)/3600;
long minute=between%3600/60;
long second=between%60;
StringBuffer time=new StringBuffer();
if(hour!=0){
time.append(hour+":");
}
if(time.length()!=0){
time.append(String.format("d:", minute));
}else if(minute!=0){
time.append(String.format("%d:", minute));
}
if(time.length()!=0){
time.append(String.format("d", second));
}else{
time.append(second);
}
return time.toString();
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有