produce them in :func:`strftime` output.
(4)
- When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used in
- calculations when the day of the week and the year are specified.
+ ``%f`` is an extension to the set of format characters in the C standard
+ (but implemented separately in datetime objects, and therefore always
+ available). When used with the :meth:`strptime` method, the ``%f``
- directive accepts from one to six digits and zero pads on the right.
++ directive accepts from one to six digits and zero pads on the right.
+
+ .. versionadded:: 2.6
(5)
- For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``,
- ``%z`` is replaced with the string ``'-0330'``.
+ For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty
+ strings.
+
+ For an aware object:
+
+ ``%z``
+ :meth:`utcoffset` is transformed into a 5-character string of the form
+ +HHMM or -HHMM, where HH is a 2-digit string giving the number of UTC
+ offset hours, and MM is a 2-digit string giving the number of UTC offset
+ minutes. For example, if :meth:`utcoffset` returns
+ ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string
+ ``'-0330'``.
+
+ ``%Z``
+ If :meth:`tzname` returns ``None``, ``%Z`` is replaced by an empty
+ string. Otherwise ``%Z`` is replaced by the returned value, which must
+ be a string.
+
+ (6)
+ When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used
+ in calculations when the day of the week and the year are specified.
.. rubric:: Footnotes