Skip to content

Google app engine(GAE)如何设置时区,获取中国时间

由于Google App Engine面向全球用户,因此它使用标准时间,这样的话如果在中国,时间就差了8个小时。

使用如下方法设置时区,获取北京时间:

from datetime import datetime, timedelta, date

def getCNnow():
return datetime.utcnow() + timedelta(hours=+8)

def getCNdate():
fdate=getCNnow()
return date(fdate.year,fdate.month,fdate.day)

print str(getCNdate())

google(2)app engine 使用(1)php gae(1)php 北京时区(1)appengine 时区(4)google app engine rss reader(1)gAE 时区(8)设置www google app(1)seo google app engine(1)时区 插件 php(1)GOOGLE APP ENGINE MYSQL(1)google app engine 日期 时区(1)GAE 设置时区(1)App Engine 时区(2)App Engine 时区问题(1)

Share in Google Reader Share in Google Reader 分享到 FriendFeed 分享到 FriendFeed 推荐到豆瓣 推荐到豆瓣 分享到 Twitter 分享到 Twitter

One Comment

  1. Dear Developer,

    Could you please make possible for a linking partner to chose a Category he or she is trying to place their link under on our web site.

    In order to avoid irrelevant links from our site to theirs.

    in other words when they place their link they will need to chose a specific category for example Health, Finance, Sport, stc.

    And another good feature would be is to be able to have a description with their link as well on our page inserted.

    Many Thanks
    Michael Malega
    immworld@gmail.com

    Posted on 16-Aug-09 at 7:46 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*