summaryrefslogtreecommitdiff
path: root/django/db/backends/utils.py
diff options
context:
space:
mode:
authorLukasz Wiecek <lukasz@yplanapp.com>2016-04-13 17:31:31 +0100
committerTim Graham <timograham@gmail.com>2016-04-18 09:49:13 -0400
commit51400cbce8165d46fdd380e80a95b6248929b38b (patch)
treeddf6d6721fd51de053deb4b6d398df9b9811405f /django/db/backends/utils.py
parent12606d2b99dbfe7d0a8f51818e81a29ea2472943 (diff)
[1.9.x] Fixed #26498 -- Fixed TimeField microseconds round-tripping on MySQL and SQLite.
Thanks adamchainz for the report and review. Backport of d3c87a2425b30400c3e6ea76585a9a537b6d0386 from master
Diffstat (limited to 'django/db/backends/utils.py')
-rw-r--r--django/db/backends/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index 84444548d3..87a51a4624 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -125,7 +125,7 @@ def typecast_time(s): # does NOT store time zone information
seconds, microseconds = seconds.split('.')
else:
microseconds = '0'
- return datetime.time(int(hour), int(minutes), int(seconds), int(float('.' + microseconds) * 1000000))
+ return datetime.time(int(hour), int(minutes), int(seconds), int((microseconds + '000000')[:6]))
def typecast_timestamp(s): # does NOT store time zone information