How to convert below date to unix format using python ?
I have checked for date month and year format but it is not working
Date: "10 Nov 2017"
Please help.
How to convert below date to unix format using python ?
I have checked for date month and year format but it is not working
Date: "10 Nov 2017"
Please help.
the problem can be solved as follows
import time
import datetime
s = "01/dec/2011"
time.mktime(datetime.datetime.strptime(s, "%d/%b/%Y").timetuple())
output:
1322697600.0
As per the doc
You can use %b for Locale’s abbreviated month name.
Try this:
import time
import datetime
s = "10 Nov 2017"
time.mktime(datetime.datetime.strptime(s, "%d %b %Y").timetuple())