This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* The term :dfn:`seconds since the epoch` refers to the total number
of elapsed seconds since the epoch, typically excluding
`leap seconds`_. Leap seconds are excluded from this total on all
POSIX-compliant platforms.
.. index:: single: Year 2038
Expand Down
Expand Up
@@ -467,7 +479,7 @@ The module defines the following functions and data items:
(2)
The range really is ``0`` to ``61``; value ``60`` is valid in
timestamps representing leap seconds and value ``61`` is supported
timestamps representing `leap seconds`_ and value ``61`` is supported
for historical reasons.
(3)
Expand Down
Expand Up
@@ -572,12 +584,28 @@ The module defines the following functions and data items:
.. function:: time()
Return the time in seconds since the epoch as a floating point number.
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 <https://en.wikipedia.org/wiki/Unix_time>`_.
To find out what the epoch is on a given platform, look at
``gmtime(0)``.
Note that even though the time is always returned as a floating point
number, not all systems provide time with a better precision than 1 second.
While this function normally returns non-decreasing values, it can return a
lower value than a previous call if the system clock has been set back between
the two calls.
lower value than a previous call if the system clock has been set back
between the two calls.
The number returned by :func:`.time` may be converted into a more common
time format (i.e. year, month, day, hour, etc...) in UTC by passing it to
:func:`gmtime` function or in local time by passing it to the
:func:`localtime` function. In both cases a
:class:`struct_time` object is returned, from which the components
of the calendar date may be accessed as attributes.
.. data:: timezone
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bpo-29026: Clarify documentation of time.time #34
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
bpo-29026: Clarify documentation of time.time #34
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing