Quote:
|
Originally Posted by Sane
I was wondering if there was an easier way to do the following:
|
import time
def timestr_to_epoch(timestr):
localtime = time.strptime(timestr, "%a %b %d %H:%M:%S %Y")
return time.mktime(localtime)
print timestr_to_epoch(time.ctime())
print time.time() --OH.