mirror of
https://github.com/django/django.git
synced 2025-09-12 05:26:27 +00:00
Fixed #22603 -- Reorganized classes in django.db.backends.
This commit is contained in:
parent
737d24923a
commit
28308078f3
69 changed files with 3098 additions and 2990 deletions
11
django/db/backends/sqlite3/utils.py
Normal file
11
django/db/backends/sqlite3/utils.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from django.conf import settings
|
||||
from django.utils import timezone
|
||||
from django.utils.dateparse import parse_datetime
|
||||
|
||||
|
||||
def parse_datetime_with_timezone_support(value):
|
||||
dt = parse_datetime(value)
|
||||
# Confirm that dt is naive before overwriting its tzinfo.
|
||||
if dt is not None and settings.USE_TZ and timezone.is_naive(dt):
|
||||
dt = dt.replace(tzinfo=timezone.utc)
|
||||
return dt
|
Loading…
Add table
Add a link
Reference in a new issue