diff options
| author | 2021-10-23 01:12:11 +0400 | |
|---|---|---|
| committer | 2021-10-23 01:12:11 +0400 | |
| commit | 3b846ae86dc0268661a54f42edca6a037b97d153 (patch) | |
| tree | 33baadcea1ca8e314e7bfaebefca96980b4df392 | |
| parent | Merge pull request #1906 from python-discord/fix-tzinfo-issue (diff) | |
| parent | Use datetime.fromtimestamp so we pass relativedelta a datetime object, not Arrow (diff) | |
Merge pull request #1908 from python-discord/fix-tz-issue
Use datetime.fromtimestamp so we pass relativedelta a datetime object…
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/moderation/infraction/management.py | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/bot/exts/moderation/infraction/management.py b/bot/exts/moderation/infraction/management.py index eaaa1e00b..1cd259a4b 100644 --- a/bot/exts/moderation/infraction/management.py +++ b/bot/exts/moderation/infraction/management.py @@ -1,9 +1,9 @@  import textwrap  import typing as t +from datetime import datetime, timezone  import dateutil.parser  import discord -from arrow import Arrow  from dateutil.relativedelta import relativedelta  from discord.ext import commands  from discord.ext.commands import Context @@ -314,7 +314,10 @@ class ModManagement(commands.Cog):          if expires_at is None:              duration = "*Permanent*"          else: -            date_from = Arrow.fromtimestamp(float(time.DISCORD_TIMESTAMP_REGEX.match(created).group(1))) +            date_from = datetime.fromtimestamp( +                float(time.DISCORD_TIMESTAMP_REGEX.match(created).group(1)), +                timezone.utc +            )              date_to = dateutil.parser.isoparse(expires_at)              duration = humanize_delta(relativedelta(date_to, date_from)) | 
