📅  最后修改于: 2022-03-11 14:52:12.587000             🧑  作者: Mango
long diff = d2.getTime() - d1.getTime();//as given
long seconds = TimeUnit.MILLISECONDS.toSeconds(diff);
long minutes = TimeUnit.MILLISECONDS.toMinutes(diff);