Google App引擎上的UTC时间? [英] UTC Time on Google App engine?

查看:249
本文介绍了Google App引擎上的UTC时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我调用System.currentTimeMillis()并存储该信息,那么当我的servlet在谷歌应用程序引擎中被击中时,什么是最好的方法?它可靠吗?



我不需要几毫秒的精度。



我只想在实体上存储日期它到达。



谢谢

解决方案

不,它不可靠。

在Dan Sanderson的编程Google App Engine一书中,他说:


值得注意的是,App Engine不保证所有Web服务器的系统
时钟都是同步的。 < ...>服务器时钟
与现实世界应用程序的时间数据源
不够一致,但对于此示例而言,它足够好。


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


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 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

这篇关于Google App引擎上的UTC时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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