summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Smeaton <josh.smeaton@gmail.com>2024-03-05 20:34:14 +1100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-03-05 12:55:17 +0100
commite45ee72d695f41164043fd30bdcca8edcc4d748e (patch)
tree1199619ea32bd3dfc106f8d3fa8e410c0e8cb5ec
parent17855bf578da756b1804542133dd1e514c15a1f3 (diff)
[5.0.x] Fixed #35267 -- Clarified time zone topic for PostgreSQL in docs.
The timezone documentation for Postgres mentions the behavior of time zone conversion, but links to the wrong setting that controls the behavior. Postgres will not return datetimes in the time zone set by the TIME_ZONE setting, but rather the time zone of the database connection, which is defined by DATABASES.TIME_ZONE setting falling back to UTC. This corrects the link in the documentation and adds note that there are two distinct TIME_ZONE settings and the one most are familiar with is not considered for PostgreSQL time zone conversion. Backport of 6e195b800aed7d6a0d2a4c073d8f3507f6beb126 from main
-rw-r--r--docs/topics/i18n/timezones.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/topics/i18n/timezones.txt b/docs/topics/i18n/timezones.txt
index 30ec916ce8..594c1688a5 100644
--- a/docs/topics/i18n/timezones.txt
+++ b/docs/topics/i18n/timezones.txt
@@ -393,9 +393,15 @@ UTC on storage, and from UTC to the connection's time zone on retrieval.
As a consequence, if you're using PostgreSQL, you can switch between ``USE_TZ
= False`` and ``USE_TZ = True`` freely. The database connection's time zone
-will be set to :setting:`TIME_ZONE` or ``UTC`` respectively, so that Django
-obtains correct datetimes in all cases. You don't need to perform any data
-conversions.
+will be set to :setting:`DATABASE-TIME_ZONE` or ``UTC`` respectively, so that
+Django obtains correct datetimes in all cases. You don't need to perform any
+data conversions.
+
+.. admonition:: Time zone settings
+
+ The :setting:`time zone <DATABASE-TIME_ZONE>` configured for the connection
+ in the :setting:`DATABASES` setting is distinct from the general
+ :setting:`TIME_ZONE` setting.
Other databases
~~~~~~~~~~~~~~~