System.currentTimeMillis();如果我更改系统时间 [英] System.currentTimeMillis(); If I change system time

查看:62
本文介绍了System.currentTimeMillis();如果我更改系统时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在00:00使用 System.currentTimeMillis(),并且得到 X 值.

If I use System.currentTimeMillis() at 00:00 and I get X value.

然后我将时钟调回一小时,一小时后,我致电 System.currentTimeMillis().

Then I set the clock back one hour, and after one hour i call System.currentTimeMillis().

它将再次返回 X ,还是只是 X + 3600 * 1000

Will it return X again, or will it just be X + 3600 * 1000

推荐答案

简而言之,每当您更改系统时间时, System.currentTimeMillis()返回的值将相应地更改.

In a nutshell, whenever you change system time, the value returned by System.currentTimeMillis() will change accordingly.

这与 System.nanoTime()相反.

这篇关于System.currentTimeMillis();如果我更改系统时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆