Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #35430 -- Corrected docs on timezone conversion in templates. #18138

Merged
merged 1 commit into from May 23, 2024

Conversation

koupro0204
Copy link
Contributor

Trac ticket number

ticket-35430

Branch description

This branch addresses an inconsistency in the Django documentation regarding how time zones are handled in templates and forms. The existing documentation suggests that time zone-aware datetime objects are translated to the end user’s time zone. However, it has been observed that Django actually uses the TIME_ZONE settings. The proposed changes correct this documentation to accurately reflect the actual behavior: when time zone support is enabled, Django stores datetime information in UTC in the database, uses time-zone-aware datetime objects internally, and translates them to the :ref:default current time zone ` in templates and forms. This update ensures that the documentation matches the implemented behavior, reducing potential confusion for developers.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

@koupro0204 koupro0204 changed the title Update timezone documentation to reflect actual behavior (#35430). Fixed #35430 -- Corrected docs on timezone conversion in templates and forms. May 7, 2024
@sarahboyce sarahboyce requested a review from claudep May 7, 2024 09:43
@koupro0204
Copy link
Contributor Author

I'm new to this, and I'm not sure if the commits are correct. Could you please confirm if everything is okay?

@sarahboyce
Copy link
Contributor

I'm new to this, and I'm not sure if the commits are correct. Could you please confirm if everything is okay?

Don't worry, it's all quite complicated. Ideally we'd have 1 commit, right now we have 4 (including a merge commit). If you have a read about git rebase/squash/reset etc I think that would help
But I will push edits to the git history (don't worry about this too much)

@sarahboyce sarahboyce force-pushed the 35430-timezone-docs-cleanup branch 2 times, most recently from 9e36858 to e5addb6 Compare May 7, 2024 10:08
@koupro0204
Copy link
Contributor Author

Don't worry, it's all quite complicated. Ideally we'd have 1 commit, right now we have 4 (including a merge commit). If you have a read about git rebase/squash/reset etc I think that would help But I will push edits to the git history (don't worry about this too much)

thank you.
I will be able to study more and contribute more from now on!

@sarahboyce sarahboyce changed the title Fixed #35430 -- Corrected docs on timezone conversion in templates and forms. Fixed #35430 -- Corrected docs on timezone conversion in templates. May 7, 2024
@sarahboyce sarahboyce force-pushed the 35430-timezone-docs-cleanup branch from e5addb6 to 03a2480 Compare May 23, 2024 08:45
@sarahboyce sarahboyce merged commit 718ed69 into django:main May 23, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants