I have datetime in following format:
Tuesday, 14 February 2017, 4:10 PM
how to convert it to epoch using python ?
Use datetime from the standard library:
datetime
from datetime import datetime date = "Tuesday, 14 February 2017, 4:10 PM" print(datetime.strptime(date, "%A, %d %B %Y, %I:%M %p").timestamp())
See here for strptime() behavior and format codes.
strptime()