标签: java time
可能重复: Calculating the Difference Between Two Java Date Instances
time1:17:05 time2:17:08
我想在几秒钟内得到差异。
答案 0 :(得分:7)
long diffInMillis = newerDate.getTime() - olderDate.getTime()
必须参加
答案 1 :(得分:0)
使用Date Class
long diffInSec = (newerDate.getTime() - olderDate.getTime())/1000;