[PEAK] DateTime, and datatype methods

R. David Murray rdmurray at bitdance.com
Tue Oct 26 18:05:19 EDT 2004


I copied the DateTime class from Bulletin.

I have mxDateTime installed on my system, but am not referencing
it in my code.

I'm using sqlite for my DM backends.

When I look at my DateTIme values retrieved from a DM, they are mx
DateTime objects.  What am I doing wrong?  Is sqlite automatically
using mx DateTime or something?  If so, why doesn't the code in
mdl_normalize fix it?

I stuck a "print type(value)" into the mdl_normalize, but it prints
out either 'str' or 'datetime.datetime'.  Yet when I do a type on
a retrieved value I get 'DateTime', and the method list (from a
'dir') looks like an mx DateTime (there is a 'ticks' member, for
example).

I'm probably doing something stupid again, but I think I
don't understand enough about how data gets loaded to figure
it out.  I don't even understand why mdl_normalize doesn't
convert a string into a datetime, and when it doesn't why
things don't break.  (I suppose that could have something to
do with the sqlite round trip.)

--David



More information about the PEAK mailing list