Python Forum
time.time() - What does it mean? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: time.time() - What does it mean? (/thread-10539.html)



time.time() - What does it mean? - Jack_Sparrow - May-24-2018

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!


RE: time.time() - What does it mean? - buran - May-24-2018

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).