diff options
| author | Josh Smeaton <josh.smeaton@gmail.com> | 2015-03-31 16:58:37 +1100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-04-24 13:55:40 -0400 |
| commit | 143255c8bbefe03ff755d7859f029f0bc7a552aa (patch) | |
| tree | 78e82ede5c90277560e304a05a55b0636c779fc2 /django/utils/timezone.py | |
| parent | 269a5dbdd37362e27b2bb3bf3a600ffd5ea2c3bb (diff) | |
Fixed #22598 -- Allowed make_aware() to work with ambiguous datetime
Diffstat (limited to 'django/utils/timezone.py')
| -rw-r--r-- | django/utils/timezone.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py index dbda90c64a..04108f658f 100644 --- a/django/utils/timezone.py +++ b/django/utils/timezone.py @@ -347,7 +347,7 @@ def is_naive(value): return value.tzinfo is None or value.tzinfo.utcoffset(value) is None -def make_aware(value, timezone=None): +def make_aware(value, timezone=None, is_dst=None): """ Makes a naive datetime.datetime in a given time zone aware. """ @@ -355,7 +355,7 @@ def make_aware(value, timezone=None): timezone = get_current_timezone() if hasattr(timezone, 'localize'): # This method is available for pytz time zones. - return timezone.localize(value, is_dst=None) + return timezone.localize(value, is_dst=is_dst) else: # Check that we won't overwrite the timezone of an aware datetime. if is_aware(value): |
