[issue5904] strftime docs do not explain locale affect on result string

Barry Alan Scott report at bugs.python.org
Sat May 2 15:25:39 CEST 2009


New submission from Barry Alan Scott <barry-scott at users.sourceforge.net>:

The result of time.strftime seems to be in the locale encoding
but this is not pointed out in the documentation.

Ideally an example like this would be in the docs to show how to
deal with strftime output:

import locale
import time

locale_encoded_time = time.strftime( '%d-%b-%Y %H:%M:%S' )

language, encoding = locale.getdefaultlocale()
unicode_time = locale_encoded_time.decode( encoding )

----------
assignee: georg.brandl
components: Documentation
messages: 86946
nosy: barry-scott, georg.brandl
severity: normal
status: open
title: strftime docs do not explain locale affect on result string
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5904>
_______________________________________


More information about the Python-bugs-list mailing list