summaryrefslogtreecommitdiff
path: root/django/db/backends/utils.py
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2019-12-11 17:59:49 +0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-12-11 13:59:49 +0100
commit88637064b3118f90ae5a402e1b47a243ef88d656 (patch)
tree9ebc84bd678a45751d7a728c6f7c38f64964b6c3 /django/db/backends/utils.py
parentec12c37384798093e359971c8980fe0c68d555bc (diff)
Refs #28373 -- Stopped setting tzinfo in typecast_timestamp().
Unnecessary since cef3f2d3c64055c9fc1757fd61dba24b557a2add. When USE_TZ=True, conn_tznames is always passed to methods that use typecast_timestamp(). Therefore, it can return naive datetimes.
Diffstat (limited to 'django/db/backends/utils.py')
-rw-r--r--django/db/backends/utils.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py
index 2416a458ba..50db093020 100644
--- a/django/db/backends/utils.py
+++ b/django/db/backends/utils.py
@@ -6,9 +6,7 @@ import logging
import time
from contextlib import contextmanager
-from django.conf import settings
from django.db.utils import NotSupportedError
-from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
@@ -170,11 +168,10 @@ def typecast_timestamp(s): # does NOT store time zone information
seconds, microseconds = seconds.split('.')
else:
microseconds = '0'
- tzinfo = utc if settings.USE_TZ else None
return datetime.datetime(
int(dates[0]), int(dates[1]), int(dates[2]),
int(times[0]), int(times[1]), int(seconds),
- int((microseconds + '000000')[:6]), tzinfo
+ int((microseconds + '000000')[:6])
)