Issue
How to convert a string in the format "%d/%m/%Y"
to timestamp?
"01/12/2011" -> 1322697600
Solution
>>> import time
>>> import datetime
>>> s = "01/12/2011"
>>> time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple())
1322697600.0
Answered By - Katriel
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.