#32513: SQLite3 Backend Falsly claims SQLite does not support Timezone aware
DateTimes
-------------------------------------+-------------------------------------
Reporter: Arthur Moore | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.1
(models, ORM) |
Severity: Normal | Resolution:
Keywords: datetime, timezone | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Arthur Moore):
Note that this code has been in the current state since commit
[https://github.com/django/django/commit/28308078f397d1de36fd0da417ac7da2544ba12d
28308078f397d1de36fd0da417ac7da2544ba12d]. Which was to
[https://code.djangoproject.com/ticket/22603 reorganize] the database.
The [https://www.sqlite.org/datatype3.html standard] (3.1.1. Affinity Name
Examples) implies that DATETIME will be converted to a number, and that is
probably what led to the confusion. In fact, some database tools
(JetBrains) do just that.* However, Django currently does not do that.
It creates the column with type "datetime", and stores it as Text.
Incidentally, this also means database tools like JetBrains can read, but
not modify DateTime columns in SQLite.
So, I guess Django is already violating the standard/convention, and the
question is should that violation be fixed, or leaned into. Fixing it
will almost certainly break any raw SQL or tool which relies on Django to
output Text. However, leaning in to the issue means the only way to apply
the "fix" later would be to add an additional "_timezone_offset" column.
\* DB Browser for SQLite does not.
--
Ticket URL: <https://code.djangoproject.com/ticket/32513#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.d742dca373a1d9e0c6bdfb0ab0de2fb3%40djangoproject.com.