Skip to content

Commit 86397cf

Browse files
gh-76075: Correct datetime.timestamp documentation (#131202)
* Clean up timestamp docs * Update datetime.rst * Suggestion
1 parent ec39fd2 commit 86397cf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Doc/library/datetime.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,11 +1502,11 @@ Instance methods:
15021502
returned by :func:`time.time`.
15031503

15041504
Naive :class:`.datetime` instances are assumed to represent local
1505-
time and this method relies on the platform C :c:func:`mktime`
1506-
function to perform the conversion. Since :class:`.datetime`
1507-
supports wider range of values than :c:func:`mktime` on many
1508-
platforms, this method may raise :exc:`OverflowError` or :exc:`OSError`
1509-
for times far in the past or far in the future.
1505+
time and this method relies on platform C functions to perform
1506+
the conversion. Since :class:`.datetime` supports a wider range of
1507+
values than the platform C functions on many platforms, this
1508+
method may raise :exc:`OverflowError` or :exc:`OSError` for times
1509+
far in the past or far in the future.
15101510

15111511
For aware :class:`.datetime` instances, the return value is computed
15121512
as::
@@ -1519,6 +1519,10 @@ Instance methods:
15191519
The :meth:`timestamp` method uses the :attr:`.fold` attribute to
15201520
disambiguate the times during a repeated interval.
15211521

1522+
.. versionchanged:: 3.6
1523+
This method no longer relies on the platform C :c:func:`mktime`
1524+
function to perform conversions.
1525+
15221526
.. note::
15231527

15241528
There is no method to obtain the POSIX timestamp directly from a

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy