Skip to content
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

gh-94300: Update datetime library documentation #95318

Merged
merged 2 commits into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
Return the local date corresponding to the POSIX timestamp, such as is
returned by :func:`time.time`.

This may raise :exc:`OverflowError`, if the timestamp is out

Check warning on line 503 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime

Check warning on line 503 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime
of the range of values supported by the platform C :c:func:`localtime`
function, and :exc:`OSError` on :c:func:`localtime` failure.
It's common for this to be restricted to years from 1970 through 2038. Note
Expand All @@ -508,7 +508,7 @@
timestamp, leap seconds are ignored by :meth:`fromtimestamp`.

.. versionchanged:: 3.3
Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp

Check warning on line 511 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime

Check warning on line 511 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime
is out of the range of values supported by the platform C
:c:func:`localtime` function. Raise :exc:`OSError` instead of
:exc:`ValueError` on :c:func:`localtime` failure.
Expand Down Expand Up @@ -618,7 +618,7 @@
timedelta.microseconds are 0, and date2 + timedelta == date1 after.

(4)
In other words, ``date1 < date2`` if and only if ``date1.toordinal() <

Check warning on line 621 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

py:meth reference target not found: timetuple
date2.toordinal()``. Date comparison raises :exc:`TypeError` if
the other comparand isn't also a :class:`date` object. However,
``NotImplemented`` is returned instead if the other comparand has a
Expand Down Expand Up @@ -729,7 +729,7 @@

time.ctime(time.mktime(d.timetuple()))

on platforms where the native C

Check warning on line 732 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: ctime
:c:func:`ctime` function (which :func:`time.ctime` invokes, but which
:meth:`date.ctime` does not invoke) conforms to the C standard.

Expand Down Expand Up @@ -869,7 +869,7 @@

Return the current local date and time.

If optional argument *tz* is ``None``

Check warning on line 872 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: gettimeofday
or not specified, this is like :meth:`today`, but, if possible, supplies more
precision than can be gotten from going through a :func:`time.time` timestamp
(for example, this may be possible on platforms supplying the C
Expand Down Expand Up @@ -907,7 +907,7 @@
If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` subclass, and the
timestamp is converted to *tz*’s time zone.

:meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is out of

Check warning on line 910 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime

Check warning on line 910 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: gmtime

Check warning on line 910 in Doc/library/datetime.rst

View workflow job for this annotation

GitHub Actions / Docs

c:func reference target not found: localtime
the range of values supported by the platform C :c:func:`localtime` or
:c:func:`gmtime` functions, and :exc:`OSError` on :c:func:`localtime` or
:c:func:`gmtime` failure.
Expand Down Expand Up @@ -1043,7 +1043,7 @@
Return a :class:`.datetime` corresponding to *date_string*, parsed according to
*format*.

This is equivalent to::
If *format* does not contain microseconds or timezone information, this is equivalent to::

datetime(*(time.strptime(date_string, format)[0:6]))

Expand Down