32 位系统的 2147483647 / 2038 年 问题

Python2.6 处理Cookie时 gmtime 总出错,明明在工作站上没问题的脚本到服务器上就罢工。又孤陋寡闻了,原来还有个2038年问题。

2.2. No "year 2038" problem anymore: that was only on 32-bit platforms.

It is worthwhile to note here that the "time_t" platform (i.e. a collection of functions in system's C shared library that deals with all kinds of time conversions, etc., on which Python is based as well) works only up to 2038-01-19T03:14:07GMT (which is the timestamp range for platform time_t on the 32-bit machines). Only functions like gmtime(<timestamp>) are affected, because they cannot take arguments (in seconds) greater than (2^31 - 1 = 2147483647): gmtime(2147483647) = Tue Jan 19 04:14:07 2038 is "the last time". http://svn.cern.ch/guest/lhcb/LHCb/trunk/Tools/CondDBUI/doc/howto_copy_files_to_db.txt

 

你可能感兴趣的:(python,2038,2147483647,gmtime)