newbie printing question
sholden at holdenweb.com
Tue Oct 16 19:40:18 CEST 2001
<adina_levin at mindspring.com> wrote in message
news:9qhdpm$ibl$1 at slb7.atl.mindspring.net...
> this is the catch:
> TimeNow is a DateTime object, not a string.
[... original "how do I get a string containing mx.DateTime's now() method's
>>> import mx.DateTime as mxdt
>>> now = str(mxdt.now())
>>> print now, type(now)
2001-10-16 13:35:30.91 <type 'string'>
Of course, you could just as easily store the DateTime value, and use it's
str() method when you needed the string: that way you could use all its
other methods and attributes as well!
>>> now = mxdt.now()
(2001, 10, 16, 13, 38, 44.919999957084656, 1, 289, 1)
More information about the Python-list