mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-17 13:01:04 +08:00
microsecond-bug-fix for datetime.datetime
This commit is contained in:
@ -51,7 +51,11 @@ def DateTime_or_None(s):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
d, t = s.split(sep, 1)
|
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):
|
except (SystemExit, KeyboardInterrupt):
|
||||||
raise
|
raise
|
||||||
except:
|
except:
|
||||||
|
Reference in New Issue
Block a user