[egenix-users] mxDateTime name conflict

Ksenia Marasanova ksenia at ksenia.nl
Mon Jan 12 16:13:42 CET 2009

Hi list / developers,

I've spent the most of this day solving a really weird problem with  
mx.DateTime module. In a web application I had a custom database type  
for SQLAlchemy:

import sqlalchemy.types as types
class mxDateTime(types.TypeDecorator):
	# some code

The problem was that every time after using this class (= updating a  
table that has a column of this type) the system time zone was  
magically changed from 'CET' to 'UTC':

from mx import DateTime
print DateTime.now().tz # prints 'CET'

instance.created = DateTime.now()
# now() is still correct
# commit...
# ...
# ....

from mx import DateTime
print DateTime.now().tz
# prints 'UTC'

After renaming my class to "MXDateTime" the problem has disappeared!  
So I just want to report that naming a class mxDateTime will probably  
cause conflict with mx.DateTime internals.


More information about the egenix-users mailing list