[ python-Bugs-1045381 ] strptime doesn't work with %U

SourceForge.net noreply at sourceforge.net
Wed Oct 13 03:57:56 CEST 2004


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

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Sebastien JUST (sebastienjust)
Assigned to: Brett Cannon (bcannon)
Summary: strptime doesn't work with %U

Initial Comment:
It seems that strptime() ignores %U. 

For example when trying to get the first day of the
42th week of year 2004. Please test on the command line : 

import time
time.strftime("%Y-%m-%d",time.strptime("2004 42 1","%Y
%U %w"))

the result is 2004-01-01 and not 2004-10-11
seems that strptime() is ignoring %U indications.

Works fine on Python 2.2, bad on Python 2.3.3 , 2.3.4
and 2.4a1.
Tested on Fedora Core 2.

Thanks

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

>Comment By: Brett Cannon (bcannon)
Date: 2004-10-12 18:57

Message:
Logged In: YES 
user_id=357491

Forgot the link to the glibc page: http://www.gnu.org/software/libc/
manual/html_node/Low-Level-Time-String-Parsing.html#Low-
Level%20Time%20String%20Parsing

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

Comment By: Brett Cannon (bcannon)
Date: 2004-10-12 18:57

Message:
Logged In: YES 
user_id=357491

Well, it looks like glibc 2.3.x doesn't even support %U or %W for 
strptime(); this might take a while to implement...

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

Comment By: Brett Cannon (bcannon)
Date: 2004-10-12 18:42

Message:
Logged In: YES 
user_id=357491

Yeah, right now it isn't supported since the calculation, at least when I 
first implemented strptime() seemed useless in terms of reversing back 
into a time tuple.  Guess there at least one way there is enough info to 
make it useful.

Now I just need to figure out how to make the calculation work.

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

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


More information about the Python-bugs-list mailing list