So clearly that's independent of what time zone you are in.Returns:
the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC.
That will be the main source of error. System clocks can be out by dozens of minutes.difference between the system clocks.
"I'm not back." - Bill Harding, Twister
Originally posted by Angela Truce:
hi,
thanks for the replies everyone.
How can the system clocks be out be dozens of minutes? That means it is dependent on the machine or something like that so System.currentTimeMillis is not independent anymore???
42
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
"I'm not back." - Bill Harding, Twister
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I have one computer whose displayed time changes by an hour if I reboot from Linux to Windows or vice versa.How can the system clocks be out be dozens of minutes?
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
Originally posted by Campbell Ritchie:
Posted by Angela Truce I have one computer whose displayed time changes by an hour if I reboot from Linux to Windows or vice versa.
"Computer science is no more about computers than astronomy is about telescopes" - Edsger Dijkstra
"I'm not back." - Bill Harding, Twister
Originally posted by Campbell Ritchie:
Posted by Angela Truce
Originally posted by Jim Yingst:
[Jeroen]: While there are some free time servers available, you don't want to make a network connection every time you want to get the time. Far too expensive.
True - or, could well be true, depending on how often you need to do this. But one reasonable alternative is to check the time once from a public timeserver when the program starts up (or when a particular class is loaded), and measure the difference between system time and "true" time. Then assume this difference remains constant, and use the
42
"I'm not back." - Bill Harding, Twister
Tony Morris
Java Q&A (FAQ, Trivia)
42
"I'm not back." - Bill Harding, Twister
Originally posted by Angela Truce:
Does anyone know how i can time stamp things? I just want to be able to record the time (preferably in seconds) to send something or the travelling time.
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery