开发者

Set timezone to EST in Google App Engine (Python)

开发者 https://www.devze.com 2023-01-28 00:01 出处:网络
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 inste

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

精彩评论

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