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:39:46 -0400
commitd3c87a2425b30400c3e6ea76585a9a537b6d0386 (patch)
treef8755c0727a7499c9dd788cf67f621fbc2a059ed /django/db/backends/utils.py
parent2c4c67af94318b15df7d9d37b936e07e8168bc73 (diff)
Fixed #26498 -- Fixed TimeField microseconds round-tripping on MySQL and SQLite.
Thanks adamchainz for the report and review.
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 dce453b7b0..c01bcc2598 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -127,7 +127,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