DateTime object

Adam Tauno Williams awilliam at whitemice.org
Fri Oct 29 07:41:44 EDT 2010


On Fri, 2010-10-29 at 13:15 +0200, jf wrote: 
> Hi,
> I've a bug in my code and I'm trying de reproduce it.
> To trace the bug I print arguments, and it produces this:
> {'date': <DateTime '20091020T00:00:00' at 558d128>}
> My question is: what is: <DateTime '20091020T00:00:00' at 558d128>?
> I use mx.DateTime put if I print it I get:
> <mx.DateTime.DateTime object for '2010-10-29 13:13:25.55' at 7f0bb54e1298>
> So what kind of object <DateTime> is ?

In this case it is clearly mx.DateTime.DateTime.

__repr__ and __str__ may produce different representations; so it can
just depend on how the 'representation' is being generated.  If you
really want to know the type of an object: use type(x)

from datetime import datetime
x = datetime.now()
type(x)
<type 'datetime.datetime'>





More information about the Python-list mailing list