我只是偶然翻过这个方法这与刚刚返回新的System.currentTimeMillis()有什么不同吗?
public static Date getNowDate() {
final Calendar cal = new GregorianCalendar();
cal.setTime(new Date());
return cal.getTime();
}
都会调用是这样的:
getNowDate().getTime()
这是从刚刚打电话
System.currentTimeMillis()
有什么不同?
我找到了一个链接http://stackoverflow.com/questions/368094/system-currenttimemillis-vs-new-date-vs-calendar-getinstance-gettime 希望它有助于 问候 – Chakri 2012-08-14 09:17:28
这'getNowDate()'方法以一种过于复杂的方式来做事 - 它属于[The Daily WTF](http://thedailywtf.com/)... – Jesper 2012-08-14 09:34:59