[Tutor] Is it possible to "backport" the datetime module of Python 3.3 to Python 3.2?

Albert-Jan Roskam fomcl at yahoo.com
Mon Apr 20 22:05:12 CEST 2015


Hi,

My Raspberry Pi 2 comes with Python 3.2 (and 2.7). I run some code that uses the datetime module but I get an error:

"AttributeError: 'datetime.datetime' object has no attribute 'timestamp'". On https://docs.python.org/3/whatsnew/3.3.html I see: "New datetime.datetime.timestamp() method: Return POSIX timestamp corresponding to thedatetime instance." Is upgrading Python 3.3 or higher my only option, or is it somehow possible to use the newer version of the datetime library for Python 3.2? I do not want to modify the source code of the library that causes the error (pysolar).

Thanks!

 
Regards,

Albert-Jan




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a 

fresh water system, and public health, what have the Romans ever done for us?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


More information about the Tutor mailing list