From ac936a838c7341c389070cd4d343f3035eb5a2d4 Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Fri, 13 May 2022 22:25:28 -0700 Subject: [PATCH 1/2] Remove mentions of C's mktime in datetime --- Doc/library/datetime.rst | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index e0b28d7cb978d9..05ca8f1bdd7cdd 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1366,13 +1366,6 @@ Instance methods: instance. The return value is a :class:`float` similar to that returned by :func:`time.time`. - Naive :class:`.datetime` instances are assumed to represent local - time and this method relies on the platform C :c:func:`mktime` - function to perform the conversion. Since :class:`.datetime` - supports wider range of values than :c:func:`mktime` on many - platforms, this method may raise :exc:`OverflowError` for times far - in the past or far in the future. - For aware :class:`.datetime` instances, the return value is computed as:: From 5df6e33262a6f5caba21e1d61e24714a19b107ce Mon Sep 17 00:00:00 2001 From: slateny <46876382+slateny@users.noreply.github.com> Date: Sat, 14 May 2022 21:41:41 -0700 Subject: [PATCH 2/2] Add raised error for out of bounds time --- Doc/library/datetime.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index 05ca8f1bdd7cdd..e387496b9fc624 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -1364,7 +1364,8 @@ Instance methods: Return POSIX timestamp corresponding to the :class:`.datetime` instance. The return value is a :class:`float` similar to that - returned by :func:`time.time`. + returned by :func:`time.time`. Raises :exc:`OSError` for times far in the + past or far in the future. For aware :class:`.datetime` instances, the return value is computed as::