]> granicus.if.org Git - python/commitdiff
#5904: Add sentence about the encoding of strftime's result.
authorR David Murray <rdmurray@bitdance.com>
Fri, 13 Jun 2014 21:23:34 +0000 (17:23 -0400)
committerR David Murray <rdmurray@bitdance.com>
Fri, 13 Jun 2014 21:23:34 +0000 (17:23 -0400)
Doc/library/time.rst

index 24b52c12f7cb8eb1d0858e5545345cd6cfccc02e..304bf0c99f1a61b4ba1b400fd4e4fda3d30ad214 100644 (file)
@@ -236,7 +236,9 @@ The module defines the following functions and data items:
    :func:`gmtime` or :func:`localtime` to a string as specified by the *format*
    argument.  If *t* is not provided, the current time as returned by
    :func:`localtime` is used.  *format* must be a string.  :exc:`ValueError` is
-   raised if any field in *t* is outside of the allowed range.
+   raised if any field in *t* is outside of the allowed range. :func:`strftime`
+   returns a locale depedent byte string; the result may be converted to unicode
+   by doing ``strftime(<myformat>).decode(locale.getlocale()[1])``.
 
    .. versionchanged:: 2.1
       Allowed *t* to be omitted.