Python - How To Display Time As Epoch?
I need to display the current time as an epoch in python to pass as a variable into some code how do I go about doing that? ie. 1458410416 Every method of import datetime datetime
Solution 1:
There is a built-in function in the time
module:
import time
seconds = time.time()
There are many functions in the time
module for seconds since the Epoch, time tuples, etc. I would recommend that you check out the docs.
Post a Comment for "Python - How To Display Time As Epoch?"