对于时间的运算,应当使用Calendar:
Calendar c = Calendar.getInstance(); //now
c.add(Calendar.HOUR, -24);
Date threshold = c.getTime();
本文介绍如何利用Java中的Calendar类来进行时间的运算,通过实例演示了如何使当前时间回溯24小时。
对于时间的运算,应当使用Calendar:
Calendar c = Calendar.getInstance(); //now
c.add(Calendar.HOUR, -24);
Date threshold = c.getTime();
1590

被折叠的 条评论
为什么被折叠?