日期

1、Java两个日期之间相差秒数

public  int calLastedTime(Date startDate) {
  long a = new Date().getTime();
  long b = startDate.getTime();
  int c = (int)((a - b) / 1000);
  return c;
 }


你可能感兴趣的:(日期类)