[ python-Bugs-898253 ] strftime ignores date format on winxp

SourceForge.net noreply at sourceforge.net
Tue Feb 17 16:50:48 EST 2004


Bugs item #898253, was opened at 2004-02-16 12:19
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=898253&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthew Sherborne (matiu)
>Assigned to: Nobody/Anonymous (nobody)
Summary: strftime ignores date format on winxp

Initial Comment:
On Windows XP in the control panel set your country to
"New Zealand".

This gives a short date format of 'dd-mm-yy'

Now in python:
>>> from time import *
>>> print strftime('%c', localtime)
02/17/04 09:15:10
>>> print strftime('%x', localtime())
02/17/04

This is giving the date in the format 'mm-dd-yy'
(American).

Could it be to do with the 'locale.nl_langinfo' bieng
unavailable in xp?

Versions:
ActivePython 2.3.2 Build 232 (ActiveState Corp.) based
on Python 2.3.2 (#49, Nov 13 2003, 10:34:54) [MSC
v.1200 32 bit (Intel)] on win32
Windows XP Home Edition (up to dateish)

----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2004-02-17 13:50

Message:
Logged In: YES 
user_id=357491

This is a Windows C library bug and nothing to do with our end.  
Since time.strftime is just a wrapper around ISO C's strftime function we 
just pass in the arguments and then pass them back out without fiddling 
with anything.

So unless there is some compiler setting that needs to be set to be more 
locale-sensitive (doubt it, but since I don't have a Windows box I have no 
way of knowing; this is why I am unassigning this from myself) this is 
probably invalid and Microsoft's fault.

----------------------------------------------------------------------

Comment By: Matthew Sherborne (matiu)
Date: 2004-02-16 12:29

Message:
Logged In: YES 
user_id=304464

Sorry, code should be:

>>> from time import *
>>> print strftime('%c', localtime())
02/17/04 09:15:10
>>> print strftime('%x', localtime())
02/17/04

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=898253&group_id=5470



More information about the Python-bugs-list mailing list