0

I want to convert datetime format to unix timestamp. How can I do this. Could anyone help me ?

import datetime
time_of_day = datetime.datetime.now()
replaced_time = time_of_day.replace(hour=0, minute=0) 
  • 2
    you can refer http://stackoverflow.com/questions/19801727/convert-datetime-to-unix-timestamp-and-convert-it-back-in-python – Iswar Nov 24 '16 at 09:05
  • 1
    Have you seen [this](http://stackoverflow.com/questions/8542723/change-datetime-to-unix-time-stamp-in-python) and [this](http://stackoverflow.com/questions/19801727/convert-datetime-to-unix-timestamp-and-convert-it-back-in-python) and [this](http://stackoverflow.com/questions/8777753/converting-datetime-date-to-utc-timestamp-in-python/8778548#8778548)? – nostradamus Nov 24 '16 at 09:06

0 Answers0