两个时间段相差的小时
/* //两个时间段相差的小时
public long diffHours(String startTime,String endTime)
{
SimpleDateFormat s1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat s2 = new SimpleDateFormat("HH:mm:ss");
long hours =0;
try {
Date startDate=s2.parse(startTime);
Date endDate=s2.parse(endTime);
long diff =endDate.getTime() - startDate.getTime();
long days = diff / (1000 * 60 * 60 * 24);
hours = (diff-days*(1000 * 60 * 60 * 24))/(1000* 60 * 60);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return hours;
}*/