【发布时间】:2012-03-20 10:29:22
【问题描述】:
我在我的项目中遇到了System.currentTimeMillis() 的问题,我在这里写了一些我遇到问题的代码
Date currentDate = new Date(System.currentTimeMillis());
Log.v("1st",""+currentDate);
Date currentDate = new Date(System.currentTimeMillis()+25*24*60*60*1000);
Log.v("2nd","25th"+currentDate);
它在第一个日志中显示当前日期,但我在当前日期添加 25 天,它在第二个日志中,但它不工作它显示 2 个月前的一天。它在 1*24*60*60*1000 到 24*24*60*60*1000 天之间工作得很好。24 天后它不工作请解决我的问题
提前致谢
【问题讨论】:
-
您能否将 +24 添加到您的代码中作为第 3 个并粘贴打印出来。