Python Forum
Datetime conversion - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Datetime conversion (/thread-13920.html)



Datetime conversion - saisankalpj - Nov-06-2018

How to convert a string like”2015-08-15 20:40:00:0000Z” to datetime.pyi format.what is difference between datetime and datetime. Pyi format


RE: Datetime conversion - ichabod801 - Nov-06-2018

You would use datetime.datetime.strptime() to convert it to a datetime.datetime object. You could them output it in whatever format you want using the strftime() method. I have no idea what datetime.pyi format is though.