strftime - %a is always Monday ?

Richard Shea richardshea at fastmail.fm
Mon Dec 29 14:03:41 CET 2003


Hi - I'm trying to use strftime to output the day of the week but I
find that I always get told it's Monday. I have tried day, month, year
etc and all come out correctly but as soon as I use %a I get 'Mon'.
I'm running Python 2.3.2 on a Windows 98 machine. Can anyone suggest
what the problem might be please ?

This is a segment of the code which is manfests the behaviour ...

>>> from time import localtime,strftime,time
>>> lst1 = ['2003','12','27']
>>> strftime("%A,%d (%w %y
%m)",[int(lst1[0]),int(lst1[1]),int(lst1[2]),0,0,0,0,0,0])
'Monday,27 (1 03 12)'
>>> 

... whereas the 27th was a Saturday ?


thanks

richard shea.




More information about the Python-list mailing list