GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-29026: Clarify documentation of time.time by appeltel · Pull Request #34 · python/cpython

Conversation

@appeltel

@appeltel appeltel commented Feb 12, 2017

Copy link
Copy Markdown
Contributor

Clarify the documentation of time.time by more
precisely defining what is meant by "seconds since
the epoch" on most platforms. Additionally explain
how gmtime and localtime may be used to extract
calendar components and convert to a more common
date format.

@Haypo

https://bugs.python.org/issue29026

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@appeltel
bpo-29026: Clarity documentation of time.time
31ce20b
Clarify the documentation of time.time by more
precisely defining what is meant by "seconds since
the epoch" on most platforms. Additionally explain
how gmtime and localtime may be used to extract
calendar components and convert to a more common
date format.
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 12, 2017
vstinner
vstinner approved these changes Feb 12, 2017
View reviewed changes
@vstinner

vstinner commented Feb 12, 2017

Copy link
Copy Markdown
Member

Thank you for the new doc. It contains more info on timezone (UTC) and leap seconds (excluded).

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner
vstinner requested changes Feb 13, 2017
View reviewed changes

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Sorry, I saw a few more minor issues.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/time.rst
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>`_.

@vstinner vstinner Feb 13, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Repeated in d387bf7

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/time.rst Outdated
.. 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

@vstinner vstinner Feb 13, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

You should add a link on the "epoch" word to its definition.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added link in d387bf7

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
berkerpeksag
berkerpeksag reviewed Feb 13, 2017
View reviewed changes
Comment thread Doc/library/time.rst Outdated
1970. To find out what the epoch is, look at ``gmtime(0)``.
* The :dfn:`epoch` is the point where the time starts, and is platform
dependent. For Unix, the epoch is January 1, 1970, 00:00:00 (UTC).
To find out what the epoch is on a given platform, look at ``gmtime(0)``.

@berkerpeksag berkerpeksag Feb 13, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I assume gmtime(0) is time.gmtime(0) here. If I'm correct, we can use this as an opportunity to make it clearer.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I changed it to time.gmtime(0) where it first appears in d387bf7. However, when the statement is repeated in the documentation of time.time, I retain gmtime(0) as this appears to be the convention used in all the function docs for the module.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Oops, failed to amend commit before pushing, I fixed to use doc conventions in 263a4f4

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/time.rst Outdated

* The term :dfn:`seconds since the epoch` refers to the total number
of elapsed seconds since the epoch, typically excluding
`leap seconds <https://en.wikipedia.org/wiki/Leap_second>`_.

@berkerpeksag berkerpeksag Feb 13, 2017

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'd say add

.. `leap seconds`: https://en.wikipedia.org/wiki/Leap_second

and use

`leap-seconds`_

everytime you need the Wikipedia article.

(I might the syntax got wrong so please try first :))

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Added in d387bf7, also changed one other mention of leap seconds to link.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@appeltel appeltel Feb 14, 2017

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Whoops, failed to add to amended commit before push - added that other mention in 263a4f4

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@berkerpeksag berkerpeksag added backport to 3.5 labels Feb 13, 2017
appeltel added 2 commits February 13, 2017 21:58
@appeltel
bpo-29026: Minor improvements for time.time doc
d387bf7
@appeltel
bpo-29026: Consistency fixes for time.time doc
263a4f4
@codecov

codecov Bot commented Feb 14, 2017

Copy link
Copy Markdown

Codecov Report

Merging #34 into master will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage   82.37%   82.38%   +0.01%     
==========================================
  Files        1427     1428       +1     
  Lines      350948   351138     +190     
==========================================
+ Hits       289088   289294     +206     
+ Misses      61860    61844      -16

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e7ffb99...263a4f4. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

methane
methane approved these changes Feb 16, 2017
View reviewed changes
vstinner
vstinner approved these changes Feb 16, 2017
View reviewed changes
@vstinner
vstinner merged commit 23557d5 into python:master Feb 16, 2017
@vstinner

vstinner commented Feb 16, 2017

Copy link
Copy Markdown
Member

Thanks! I merged the PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Mariatta referenced this pull request in Mariatta/cpython Mar 3, 2017
@appeltel @Mariatta
bpo-29026: Clarify documentation of time.time (#34)
399f023
* bpo-29026: Clarity documentation of time.time

Clarify the documentation of time.time by more
precisely defining what is meant by "seconds since
the epoch" on most platforms. Additionally explain
how gmtime and localtime may be used to extract
calendar components and convert to a more common
date format.

* bpo-29026: Minor improvements for time.time doc

* bpo-29026: Consistency fixes for time.time doc

(cherry picked from commit 23557d5)
Mariatta referenced this pull request in Mariatta/cpython Mar 3, 2017
@appeltel @Mariatta
bpo-29026: Clarify documentation of time.time (#34)
745149a
* bpo-29026: Clarity documentation of time.time

Clarify the documentation of time.time by more
precisely defining what is meant by "seconds since
the epoch" on most platforms. Additionally explain
how gmtime and localtime may be used to extract
calendar components and convert to a more common
date format.

* bpo-29026: Minor improvements for time.time doc

* bpo-29026: Consistency fixes for time.time doc

(cherry picked from commit 23557d5)
@Mariatta Mariatta removed needs backport to 3.5 labels Mar 3, 2017
Mariatta added a commit that referenced this pull request Mar 3, 2017
@Mariatta
bpo-29026: Clarify documentation of time.time (GH-34) (GH-417)
b8f5d07
(cherry picked from commit 23557d5)
Mariatta added a commit that referenced this pull request Mar 3, 2017
@Mariatta
bpo-29026: Clarify documentation of time.time (GH-34) (GH-418)
8c851fa
(cherry picked from commit 23557d5)
@ghost ghost mentioned this pull request Sep 24, 2017
Make 2.8-slp compatible with PEP 0404 discussion stackless-dev/stackless#33
Closed
tiran pushed a commit to tiran/cpython that referenced this pull request Aug 21, 2022
@pablogsal
Merge pull request python#34 from tiran/perf-2
ed16d98
munmap pages on shutdown, keep FILE open
@mdboom mdboom mentioned this pull request Aug 25, 2022
Assert and incorrect error message when loading source file containing invalid UTF-8 #96268
Closed
@ziegenbalg ziegenbalg mentioned this pull request Nov 30, 2022
double free in io.TextIOWrapper #72573
Closed
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@Mariatta
Setting up CPython repo is now done in the worker app. (GH-34)
b1e1128
Instead of in the main app.
jaraco pushed a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@warsaw
Add API documentation (python#34)
3e9cda3
API documentation.

Closes python#16
oraluben pushed a commit to oraluben/cpython that referenced this pull request Jun 25, 2023
@JuliaPoo @Fidget-Spinner
Fix: mark interpreter frames as tier 2 or not (python#34)
ce02765
* fix: mark interpreter frames as tier 2 or not

* Test: Added tests for python#33

---------

Co-authored-by: Ken Jin <[email protected]>
@gvanrossum gvanrossum mentioned this pull request Aug 22, 2023
heap-use-after-free in _PyFunction_LookupByVersion #108253
Closed
@LinanV LinanV mentioned this pull request Oct 23, 2023
Objects/typeobject.c: No such file or directory. #111203
Closed
@kcatss kcatss mentioned this pull request Nov 15, 2023
Use-after-free in unregister() of atexit module #112127
Closed
nanjekyejoannah pushed a commit to nanjekyejoannah/cpython that referenced this pull request Feb 20, 2024
@ltratt
Merge pull request python#34 from nanjekyejoannah/warn_string_cmp_wit…
bb5d72c
…h_recent_assumptions

Warn for string cmp with new string warning assumptions
@kcatss kcatss mentioned this pull request Feb 20, 2024
Use After Free at _heapreplace_max #115706
Closed
@ngoldbaum ngoldbaum mentioned this pull request Sep 23, 2024
Crash running PyO3 tests with --test-threads=1000 #124375
Closed
This was referenced Feb 11, 2025
segmentfault when pip installing setuptools #129992
Closed
segmentfault when pip installing setuptools #129993
Closed
@DominiquePACCO DominiquePACCO mentioned this pull request Jun 3, 2025
PdfWriter add_page adds (re)writes old page instead of new #135062
Closed
picnixz added a commit to picnixz/cpython that referenced this pull request Dec 8, 2025
@picnixz
Fix missing lazy-related symbols for the JIT (python#34)
5000033
* fix missing `PyLazyImport_CheckExact`

* fix missing lazy-related symbols

* fix missing lazy-related symbols

* `extern` seems enough

* Export _PyImport_LoadLazyImportTstate for JIT
@sergey-miryanov sergey-miryanov mentioned this pull request Dec 18, 2025
Observed memory leak in ssl library: Python 3.14 GC issue #142516
Closed
@Qanux Qanux mentioned this pull request Feb 11, 2026
heap-buffer-overflow in functools.partial.__repr__() #144475
Closed
@ngoldbaum ngoldbaum mentioned this pull request Mar 6, 2026
Remove deprecated and undocumented function ctypes.SetPointerType #133866
Closed
@johng johng mentioned this pull request Jul 19, 2026
use-after-free: functools partial #154189
Closed
@djarfluka djarfluka mentioned this pull request Sep 12, 2026
Heap UAF in io.TextIOWrapper read path via reentrant detach() #157363
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@berkerpeksag berkerpeksag berkerpeksag left review comments
@vstinner vstinner vstinner approved these changes
@methane methane methane approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@appeltel @vstinner @berkerpeksag @methane @Mariatta @the-knights-who-say-ni
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.