Skip to content

Commit

Permalink
Merge pull request #2699 from marshmallow-code/fix
Browse files Browse the repository at this point in the history
Fix format specifiers in get_fixed_timezone
  • Loading branch information
lafrech authored Dec 30, 2024
2 parents fca9e01 + 2b835ec commit fca871a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/marshmallow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_fixed_timezone(offset: int | float | dt.timedelta) -> dt.timezone:
if isinstance(offset, dt.timedelta):
offset = offset.total_seconds() // 60
sign = "-" if offset < 0 else "+"
hhmm = "%02d%02d".format(*divmod(abs(offset), 60))
hhmm = "{:02d}{:02d}".format(*divmod(abs(offset), 60))
name = sign + hhmm
return dt.timezone(dt.timedelta(minutes=offset), name)

Expand Down

0 comments on commit fca871a

Please sign in to comment.