查找2 java.sql.Timestamps之间的小时或分钟差异?

查找2 java.sql.Timestamps之间的小时或分钟差异?,第1张

查找2 java.sql.Timestamps之间的小时或分钟差异

我结束使用了此工具,只想将其发布给其他人(如果他们正在搜索)。

public static long compareTwoTimeStamps(java.sql.Timestamp currentTime, java.sql.Timestamp oldTime){    long milliseconds1 = oldTime.getTime();  long milliseconds2 = currentTime.getTime();  long diff = milliseconds2 - milliseconds1;  long diffSeconds = diff / 1000;  long diffMinutes = diff / (60 * 1000);  long diffHours = diff / (60 * 60 * 1000);  long diffDays = diff / (24 * 60 * 60 * 1000);    return diffMinutes;}


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4957806.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存