DateTime object

M.-A. Lemburg mal at
Thu Nov 4 17:52:04 CET 2010

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 ?

You might be using the old Python implementation of mxDateTime

    def __repr__(self):
        return "<DateTime object for '%d-%02d-%02d %02d:%02d:%05.2f' at %x>"% (
            self.year, self.month,, self.hour, self.minute,
            self.second, id(self))

Note however, that there's no "T" in the string shown for the
repr(), so perhaps this is some other implementation.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Nov 04 2010)
>>> Python/Zope Consulting and Support ...
>>> mxODBC.Zope.Database.Adapter ...   
>>> mxODBC, mxDateTime, mxTextTools ...

::: Try our new mxODBC.Connect Python Database Interface for free ! :::: Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-list mailing list