以下是代码段:
public static void main(String[] args) {
// TODO code application logic here
long oneMonthAgo=30*24*60*60*1000;
Date now = new Date();
Date twf=new Date(now.getTime()-oneMonthAgo);
System.out.println(twf.before(now));
}
这输出错误
虽然这段代码如下:
public static void main(String[] args) {
// TODO code application logic here
long twentyDaysAgo=20*24*60*60*1000;
Date now = new Date();
Date twf=new Date(now.getTime()-twentyDaysAgo);
System.out.println(twf.before(now));
}
输出:True
不够奇怪 ?