Skip to content
Merged
Changes from all commits
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
14 changes: 4 additions & 10 deletions Doc/library/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,12 @@ Objects of the :class:`date` type are always naive.

An object of type :class:`.time` or :class:`.datetime` may be aware or naive.

A :class:`.datetime` object ``d`` is aware if both of the following hold:

1. ``d.tzinfo`` is not ``None``
2. ``d.tzinfo.utcoffset(d)`` does not return ``None``

A :class:`.datetime` object ``d`` is aware if
:meth:`d.utcoffset() <datetime.utcoffset>` does not return ``None``.
Otherwise, ``d`` is naive.

A :class:`.time` object ``t`` is aware if both of the following hold:

1. ``t.tzinfo`` is not ``None``
2. ``t.tzinfo.utcoffset(None)`` does not return ``None``.

A :class:`.time` object ``t`` is aware if
:meth:`t.utcoffset() <time.utcoffset>` does not return ``None``.
Otherwise, ``t`` is naive.

The distinction between aware and naive doesn't apply to :class:`timedelta`
Expand Down
Loading