开发者

UTC Time on Google App engine?

开发者 https://www.devze.com 2022-12-26 03:32 出处:网络
What\'s the best way to work out the time when my servlet in google app engine is hit ? if I call System.currentTimeMillis() and store that info will it be reliable ?

What's the best way to work out the time when my servlet in google app engine is hit ?

if I call System.currentTimeMillis() and store that info will it be reliable ?

I 开发者_C百科don't need milliseconds precision.

I just want to store an entity with the date on when it arrives.

Thanks


No, it won't be reliable.

In Dan Sanderson's book, "Programming Google App Engine" he says:

It's worth noting that App Engine makes no guarantees that the system clocks of all of its web servers are synchronized. <...> The server clock is not consistent enough as a source of time data for a real-world application, but it's good enough for this example.

http://books.google.com/books?id=6cL_kCZ4NJ4C&lpg=PA25&dq=clocks%20synchronized%20google%20app%20engine&pg=PA25#v=onepage&q=clocks%20synchronized%20google%20app%20engine&f=false


if I call System.currentTimeMillis() and store that info will it be reliable ?

Yes.

0

精彩评论

暂无评论...
验证码 换一张
取 消