Skip to content

Commit

Permalink
Fix format specifiers in get_fixed_timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
sloria committed Dec 30, 2024
1 parent fca9e01 commit 2b835ec
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 2b835ec

Please sign in to comment.