计算2个日期的差

走着路睡觉
  • java
小于 1 分钟

long diff = d2.getTime() - d1.getTime();//as given

long seconds = TimeUnit.MILLISECONDS.toSeconds(diff);
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff); 
上次编辑于:
贡献者: zhaojingbo
Loading...