简体   繁体   English

System.currentTimeMillis是否代表UTC时间?

[英]Does System.currentTimeMillis represent UTC time?

System.currentTimeMillis()表示UTC时间还是本地系统时间?

UTC - it's the number of milliseconds since midnight on January 1st 1970 UTC (modulo leap seconds, potentially). UTC - 它是1970年1月1日午夜(可能是模数闰秒)以来的毫秒数。

Obviously it's reliant on the local system clock , but it doesn't depend on the local system time zone . 显然它依赖于本地系统时钟 ,但它不依赖于本地系统时区

(It's a shame that the Javadoc isn't clearer on this, admittedly.) (遗憾的是,Javadoc对此并不清楚,这是一种耻辱。)

UTC according to oracle.com. UTC根据oracle.com。 http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/System.html#currentTimeMillis http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/System.html#currentTimeMillis

"currentTimeMillis “的currentTimeMillis

Returns: 返回:

the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC." 当前时间与UTC时间1970年1月1日午夜之间的差异,以毫秒为单位。“

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM