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

Generate timezone-aware dates and datetimes if the timezone support is enabled. #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

leporo
Copy link

@leporo leporo commented Jun 19, 2012

One can get a huge amount of warnings looking like this:

/django/db/models/fields/init.py:808: RuntimeWarning: DateTimeField received a naive datetime (1999-01-25 20:06:41) while time zone support is active.

when the Django 1.4 timezone support is enabled.

This patch fixes the issue.

It also fixes another issue: sometimes a generated datetime value becomes invalid when timezone rules are applied to it. Each year we skip a hour when applying daytime saving time rules. Sometimes a generated 'naive' value hits one of these skipped hours when become a timezone-aware. This may result in random errors and test failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants