两个时间段相差的小时
摘要:
/* //两个时间段相差的小时 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 阅读全文