1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #26498 -- Fixed TimeField microseconds round-tripping on MySQL and SQLite.

Thanks adamchainz for the report and review.
This commit is contained in:
Lukasz Wiecek
2016-04-13 17:31:31 +01:00
committed by Tim Graham
parent 2c4c67af94
commit d3c87a2425
4 changed files with 9 additions and 2 deletions

View File

@@ -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