diff options
author | Sylvain <syt@logilab.fr> | 2006-10-31 19:17:44 +0100 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2006-10-31 19:17:44 +0100 |
commit | f589054f7a557636b093d333fe2bfc77e8f4b238 (patch) | |
tree | 34aaa44e11208a3ccd8d062b70301c40a33f9363 /db.py | |
parent | 16ee6e31edb28e80fd4e5545a8b164f2c0472069 (diff) | |
download | logilab-common-f589054f7a557636b093d333fe2bfc77e8f4b238.tar.gz |
fix
Diffstat (limited to 'db.py')
-rw-r--r-- | db.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -230,7 +230,10 @@ class _Psycopg2Adapter(_PsycopgAdapter): def cast_datetime(value, cursor): if value: - return strptime(value, '%Y-%m-%d %H:%M:%S') + # XXX value.split('.', 1)[0] to protect against + # date such as 2006-10-31 19:09:34.29 + return strptime(value.split('.', 1)[0], + '%Y-%m-%d %H:%M:%S') DATETIME = extensions.new_type(psycopg2.DATETIME.values, "DATETIME", cast_datetime) for v in DATETIME.values: |