I have a time in UTC from which I want the number of seconds since epoch.
I am using strftime to convert it to the number of seconds. Taking 1st April 2012 as an exa
This works in Python 2 and 3:
>>> import time >>> import calendar >>> calendar.timegm(time.gmtime()) 1504917998
Just following the official docs... https://docs.python.org/2/library/time.html#module-time