2012-06-05 2 views
0

Python datetime.fromtimestamp возвращает другое значение в App Engine Python 2.5 vs 2.7.Временные метки Python, отличающиеся от 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 возвращает нужное значение. Что мне не хватает?

ответ

3

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

Спасибо! Похоже на обходное решение [здесь] (http://stackoverflow.com/questions/10588027/converting-timestamps-larger-than-maxint-into-datetime-objects) – Silitek