【问题标题】:Python Timestamps Differing on App Engine Python 2.5 / 2.7App Engine Python 2.5 / 2.7 上的 Python 时间戳不同
【发布时间】:2012-06-05 12:28:01
【问题描述】:

Python datetime.fromtimestamp 在 App Engine Python 2.5 和 2.7 上返回不同的值。

http://shell.appspot.com/

Google App Engine/1.6.6
Python 2.5.2 (r252:60911, May 17 2011, 11:51:03) 
[GCC 4.3.1]

>>> import datetime
>>> print datetime.datetime.fromtimestamp(4102444800)
2100-01-01 00:00:00

http://shell-27.appspot.com/

Google App Engine/1.6.6
Python 2.7.2 (default, Dec 14 2011, 14:36:31) 
[GCC 4.4.3]

>>> import datetime
>>> print datetime.datetime.fromtimestamp(4102444800)
1963-11-25 17:31:44

2.5 实例正在返回所需的值。我错过了什么?

【问题讨论】:

    标签: python google-app-engine python-2.7 python-2.5


    【解决方案1】:

    2.5:

    Google App Engine/1.6.6
    Python 2.5.2 (r252:60911, May 17 2011, 11:51:03) 
    [GCC 4.3.1]
    
    >>> import sys
    >>> sys.maxint
    9223372036854775807
    

    2.7:

    Google App Engine/1.6.6
    Python 2.7.2 (default, Dec 14 2011, 14:36:31) 
    [GCC 4.4.3]
    
    >>> import sys
    >>> sys.maxint
    2147483647
    

    【讨论】:

    • 谢谢!看起来像一个解决方法here
    猜你喜欢
    • 1970-01-01
    • 2012-04-27
    • 2012-04-14
    • 2012-11-17
    • 2018-04-29
    • 2013-10-28
    • 2012-03-10
    • 2011-07-09
    • 1970-01-01
    相关资源
    最近更新 更多