@@ -1734,10 +1734,7 @@ made to civil time.
17341734 otherwise :exc: `ValueError ` is raised.
17351735
17361736 The *name * argument is optional. If specified it must be a string that
1737- is used as the value returned by the ``tzname(dt) `` method. Otherwise,
1738- ``tzname(dt) `` returns a string 'UTCsHH:MM', where s is the sign of
1739- *offset *, HH and MM are two digits of ``offset.hours `` and
1740- ``offset.minutes `` respectively.
1737+ will be used as the value returned by the :meth: `datetime.tzname ` method.
17411738
17421739 .. versionadded :: 3.2
17431740
@@ -1750,11 +1747,19 @@ made to civil time.
17501747
17511748.. method :: timezone.tzname(dt)
17521749
1753- Return the fixed value specified when the :class: `timezone ` instance is
1754- constructed or a string 'UTCsHH:MM', where s is the sign of
1755- *offset *, HH and MM are two digits of ``offset.hours `` and
1750+ Return the fixed value specified when the :class: `timezone ` instance
1751+ is constructed. If *name * is not provided in the constructor, the
1752+ name returned by ``tzname(dt) `` is generated from the value of the
1753+ ``offset `` as follows. If *offset * is ``timedelta(0) ``, the name
1754+ is "UTC", otherwise it is a string 'UTC±HH:MM', where ± is the sign
1755+ of ``offset ``, HH and MM are two digits of ``offset.hours `` and
17561756 ``offset.minutes `` respectively.
17571757
1758+ .. versionchanged :: 3.6
1759+ Name generated from ``offset=timedelta(0) `` is now plain 'UTC', not
1760+ 'UTC+00:00'.
1761+
1762+
17581763.. method :: timezone.dst(dt)
17591764
17601765 Always returns ``None ``.
0 commit comments