8000 bpo-29026: Clarify documentation of time.time by appeltel · Pull Request #34 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-29026: Clarify documentation of time.time #34

New issue

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

Merged
merged 3 commits into from
Feb 16, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
bpo-29026: Consistency fixes for time.time doc
  • Loading branch information
appeltel committed Feb 14, 2017
commit 263a4f476615210322c89b6dba0abdd414db02e0
12 changes: 6 additions & 6 deletions Doc/library/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -479,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 @@ -592,19 +592,19 @@ The module defines the following functions and data items:
in seconds since the epoch. This is commonly referred to as
`Unix time <https://en.wikipedia.org/wiki/Unix_time>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO it's worth it to repeat here:

To find out what the epoch is on a given platform, look at gmtime(0).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repeated in d387bf7

To find out what the epoch is on a given platform, look at
``time.gmtime(0)``.
``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.

The number returned by :func:`time.time` may be converted into a more common
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:`time.gmtime` function or in local time by passing it to the
:func:`time.localtime` function. In both cases a
:class:`time.struct_time` object is returned, from which the components
: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
0