开发者

Set timezone to EST in Google App Engine (Python)

Can anyone advise how I change the timezone for my google app engine application? It's running python, I need to 开发者_如何学运维set the timezone so all datetime.now() etc work on EST timezone instead of the default?

Thanks!


Have a look at http://timezones.appspot.com/

You can not make datetime.now() to use your custom time zone but you can convert time as per your requirements.


You can also use the dateutil library:

datetime.datetime.now(dateutil.tz.tzutc())

...to get the now() time for UTC, for instance.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜