【发布时间】:2012-10-22 11:29:59
【问题描述】:
给定:
private Calendar calendarInstance = Calendar.getInstance();
public long inMillis() {
calendarInstance.set(year, month, day, hour, min);
return calendarInstance.getTimeInMillis();
}
据我了解,结果会随着纪元以来的时间返回,以毫秒为单位
当前时间,从纪元算起的 UTC 毫秒数。
鉴于我的测试总是设置相同的对象,为什么随着时间的推移结果会有所不同?
detailedMoment = new MomentInTime(2012, 11, 1, 19, 9);
detailedMoment.inMillis() // gives different results as time passes by
更新:
我继续猜测自己是因为
在同一时间段内我得到了
1_351_796_940 // http://www.epochconverter.com
1_354_410_540 // my number
【问题讨论】: