diff options
Diffstat (limited to 'pelican/utils.py')
-rw-r--r-- | pelican/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pelican/utils.py b/pelican/utils.py index 5e4822ba..31ab5489 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -538,7 +538,9 @@ def set_date_tzinfo(d, tz_name=None): """Set the timezone for dates that don't have tzinfo""" if tz_name and not d.tzinfo: tz = pytz.timezone(tz_name) - return tz.localize(d) + d = tz.localize(d) + return SafeDatetime(d.year, d.month, d.day, d.hour, d.minute, d.second, + d.microsecond, d.tzinfo) return d |