How to get the seconds since epoch from the time + date output of gmtime()? October 14, 2022 by Tarik Use the time module: import time epoch_time = int(time.time())