DateTime Format Stuff

Kenneth Godee Ken at perfect-image.com
Mon Dec 30 14:04:58 EST 2002


I'm pulling a date from a database and is returned as a
tuple ie....

(<DateTime object for '2002-11-26 00:00:00.00' at 82237f0>, 99999)

and I can...

print rows4[0][0] and get...
2002-11-26 00:00:00.00

or..

str(rows4[0][0])
2002-11-26 00:00:00.00

My question is what's the easiest way to change 
the format of the above output from a tuple 
to something like 11/26/2002.
I have mxDateTime, time, etc., just can't be as hard
as I'm making it, All the time modules seem to
have a lot of functions that work great on system time
like....
strftime("%m/%d/%Y", localtime())
gives me what I want,but won't work on the tuple from
the database.

or should I just re the above and custom make my own output?
Just figured there's some function I'm missing that makes this
very easy?





More information about the Python-list mailing list