strptime in 2.3.3

Glawster andywil at nortelnetworks.com
Thu Mar 25 07:48:01 EST 2004


Folks,

I am parsing a list of directories that have a name format
'YearWeekNoDay', using the follwoing code

            print list_dir[j]
            print "%s" % (time.strptime (list_dir[j], '%Y%U%w'))
            ttuple = time.strptime (list_dir[j], '%Y%U%w')
            year   = ttuple[0]
            month  = ttuple[1]
            day    = ttuple[2]
            print day, month, year

I get the following output:

2004123
(2004, 1, 1, 0, 0, 0, 2, 1, -1)
1 1 2004

2004124
(2004, 1, 1, 0, 0, 0, 3, 1, -1)
1 1 2004

strptime doesn't seem to be treating this correctly, have I missed
something?

It works in python 2.2.2, I have tested this on both a solaris and
linux version of 2.3.3

Thanks,
Andy



More information about the Python-list mailing list