DateTime object

M.-A. Lemburg mal at egenix.com
Thu Nov 4 12:52:04 EDT 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
(mx/DateTime/mxDateTime/mxDateTime_Python.py):

    def __repr__(self):
        return "<DateTime object for '%d-%02d-%02d %02d:%02d:%05.2f' at %x>"% (
            self.year, self.month, self.day, 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
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 04 2010)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com 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
               http://www.egenix.com/company/contact/



More information about the Python-list mailing list