Getting time difference in python 2.7
I am importing some data from REST API into a list. One of the columns contains only date / time.
Column A format / example: 2015-06-11 07:59:10.000 GMT
I need to be able to check the time difference between two lines, I tried using
datetime.strptime(variable_name, "%Y-%m-%d %H:%M:%S")
however i got the following error:
ValueError: unconverted data remains: .000 GMT
Is there a way to fix this without changing or removing the offending portion from every entry on my list?
Any help would be greatly appreciated.
+3
source to share
2 answers