How System.currentTimeMillis()/1000 working in JAVA

ArrchanaMohan :

I just want to understand the currentTimeMillis()/1000L method in System class. As per my understanding that this method will return current time in seconds. I have a doubt here If I run the same code in Local jvm (IST) , and remote box(Sanjose) will return different values as output?

Can someone explain me how does it work if we run the code in different JVM which is USA and India what will be the output. Does it return same output? or different?

irahavoi :

It returns number of ms since the beginning of unix epoch, which is time-zone independent. Therefore, it should return the same output.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=115914&siteId=1