I run the following code on Heroku using the console:
~ $ python
Python 3.6.6 (default, Aug 1 2018, 21:10:15)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.fromisoformat("2015-06-06T17:23:54+10:00")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: type object 'datetime.datetime' has no attribute 'fromisoformat'
>>>
This works perfectly well on my Mac under Python 3.7.0.
How do I access 'fromisoformat' running under Heroku?
Stupid me. 'fromisofomat' only appeared with Python3.7.0. heroku default is Python3.6.6. Added a runtime.txt with python-3.7.0 and everything now works.
Hope this helps someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With