Loading django/db/backends/utils.py +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading docs/releases/1.8.13.txt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ Django 1.8.13 fixes several bugs in 1.8.12. Bugfixes ======== * ... * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`). docs/releases/1.9.6.txt +3 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,6 @@ Bugfixes * Added support for relative path redirects to ``SimpleTestCase.assertRedirects()`` because Django 1.9 no longer converts redirects to absolute URIs (:ticket:`26428`). * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`). tests/db_typecasts/tests.py +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ TEST_CASES = { ('00:00:12', datetime.time(0, 0, 12)), ('00:00:12.5', datetime.time(0, 0, 12, 500000)), ('7:22:13.312', datetime.time(7, 22, 13, 312000)), ('12:45:30.126631', datetime.time(12, 45, 30, 126631)), ('12:45:30.126630', datetime.time(12, 45, 30, 126630)), ('12:45:30.123456789', datetime.time(12, 45, 30, 123456)), ), 'typecast_timestamp': ( ('', None), Loading Loading
django/db/backends/utils.py +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
docs/releases/1.8.13.txt +2 −1 Original line number Diff line number Diff line Loading @@ -9,4 +9,5 @@ Django 1.8.13 fixes several bugs in 1.8.12. Bugfixes ======== * ... * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`).
docs/releases/1.9.6.txt +3 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,6 @@ Bugfixes * Added support for relative path redirects to ``SimpleTestCase.assertRedirects()`` because Django 1.9 no longer converts redirects to absolute URIs (:ticket:`26428`). * Fixed ``TimeField`` microseconds round-tripping on MySQL and SQLite (:ticket:`26498`).
tests/db_typecasts/tests.py +3 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,9 @@ TEST_CASES = { ('00:00:12', datetime.time(0, 0, 12)), ('00:00:12.5', datetime.time(0, 0, 12, 500000)), ('7:22:13.312', datetime.time(7, 22, 13, 312000)), ('12:45:30.126631', datetime.time(12, 45, 30, 126631)), ('12:45:30.126630', datetime.time(12, 45, 30, 126630)), ('12:45:30.123456789', datetime.time(12, 45, 30, 123456)), ), 'typecast_timestamp': ( ('', None), Loading