比较两个时间返回相差秒数

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_41650354/article/details/81876396

public static int getIntvalSecond(Date sourcetime ,  Date currentime) {

long l  =  currentime.getTime() - sourcetime.getTime();

return (int) l / 1000;

}

猜你喜欢

转载自blog.csdn.net/qq_41650354/article/details/81876396