diff options
author | jinuk84.kim <jinuk84.kim@lge.com> | 2013-11-08 11:51:31 +0900 |
---|---|---|
committer | jinuk84.kim <jinuk84.kim@lge.com> | 2013-11-08 11:51:31 +0900 |
commit | 100485f627be833caa11e68e4cf11d89db5fcd86 (patch) | |
tree | efd1811fd354ce5d6e716d7fff8f41b812a926bc | |
parent | c8b2744ea2b1e4419b7e3d93928e92c95f366815 (diff) | |
download | mysqldb1-100485f627be833caa11e68e4cf11d89db5fcd86.tar.gz |
microsecond-bug-fix for datetime.datetime
-rw-r--r-- | MySQLdb/times.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MySQLdb/times.py b/MySQLdb/times.py index f3a92d7..4040f8e 100644 --- a/MySQLdb/times.py +++ b/MySQLdb/times.py @@ -51,7 +51,11 @@ def DateTime_or_None(s): try: d, t = s.split(sep, 1) - return datetime(*[ int(x) for x in d.split('-')+t.split(':') ]) + if '.' in t: + t, m = t.split('.',1) + else: + m = 0 + return datetime(*[ int(x) for x in d.split('-')+t.split(':')+[m] ]) except (SystemExit, KeyboardInterrupt): raise except: |