mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #28739 -- Fixed get_fixed_timezone() for negative timedeltas.
This commit is contained in:
@@ -58,7 +58,7 @@ utc = pytz.utc
|
||||
def get_fixed_timezone(offset):
|
||||
"""Return a tzinfo instance with a fixed offset from UTC."""
|
||||
if isinstance(offset, timedelta):
|
||||
offset = offset.seconds // 60
|
||||
offset = offset.total_seconds() // 60
|
||||
sign = '-' if offset < 0 else '+'
|
||||
hhmm = '%02d%02d' % divmod(abs(offset), 60)
|
||||
name = sign + hhmm
|
||||
|
||||
Reference in New Issue
Block a user