diff options
Diffstat (limited to 'MySQLdb')
-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: |