Python Forum

Full Version: time.time() - What does it mean?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello there,
I am a new user of Python and I don't understand, what does this mean?
time.time()

I found this description to that:

Return the time in seconds since the epoch as a floating point number....

But what does "epoch" mean in this case? From which point does Python begin to calculate the seconds?

Thank you!
Documentation, documentation, documentation - it's always your best friend and first place to look for answers
https://docs.python.org/3/library/time.html#time.time
Quote:Return the time in seconds since the epoch as a floating point number. The specific date of the epoch and the handling of leap seconds is platform dependent. On Windows and most Unix systems, the epoch is January 1, 1970, 00:00:00 (UTC) and leap seconds are not counted towards the time in seconds since the epoch. This is commonly referred to as Unix time. To find out what the epoch is on a given platform, look at gmtime(0).