Skip to content

Commit

Permalink
treat negative timedeltas the same way as positive ones
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed May 31, 2024
1 parent 7f29e9e commit 859876a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion beaker/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def format_since(since: Union[datetime, timedelta, str]) -> str:
since = since.astimezone(timezone.utc)
return since.strftime("%Y-%m-%dT%H:%M:%S.%fZ")
elif isinstance(since, timedelta):
return format_since(datetime.now(tz=timezone.utc) - since)
return format_since(datetime.now(tz=timezone.utc) - abs(since))
else:
return since

Expand Down

0 comments on commit 859876a

Please sign in to comment.