diff -r 0e56d79fa2ab Doc/library/datetime.rst --- a/Doc/library/datetime.rst Tue May 24 18:29:46 2011 +0200 +++ b/Doc/library/datetime.rst Fri Jun 03 16:59:55 2011 -0500 @@ -1763,6 +1763,29 @@ | ``%%`` | A literal ``'%'`` character. | | +-----------+--------------------------------+-------+ +Several additional directives not required by the C89 standard are included for +convenience. These parameters all correspond to ISO 8601 date values. These +may may not be available on all platforms when used with the :meth:`strftime` +method. + ++-----------+--------------------------------+-------+ +| Directive | Meaning | Notes | ++===========+================================+=======+ +| ``%G`` | ISO 8601 year. Decimal number | \(7) | +| | [0000,9999] representin the | | +| | year that contains the greater | | +| | part of the ISO week (%V). | | ++-----------+--------------------------------+-------+ +| ``%u`` | ISO 8601 week day as a decimal | | +| | number [1(Monday),7]. | | ++-----------+--------------------------------+-------+ +| ``%V`` | ISO 8601 week as a decimal | \(7) | +| | number [01,53] with Monday as | | +| | the first day of the week. | | +| | Week 01 is the week containing | | +| | Jan 4. | | ++-----------+--------------------------------+-------+ + Notes: (1) @@ -1782,7 +1805,8 @@ (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. + calculations when the day of the week and the calendar year (``%Y``) are + specified. (5) The :meth:`strptime` method can @@ -1801,6 +1825,12 @@ For example, if :meth:`utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string ``'-0330'``. +(7) + Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the + day of the week and the ISO year (``%G``) are specified when used with the + :meth:`strptime` method. Also note that ``%G`` and ``%Y`` are not + interchangable. + .. versionchanged:: 3.2 When the ``%z`` directive is provided to the :meth:`strptime` method, an aware :class:`datetime` object will be produced. The ``tzinfo`` of the