From 571444b31c50e723761df080013e5f0dcfddd719 Mon Sep 17 00:00:00 2001 From: dgw Date: Fri, 2 Jun 2023 03:00:32 -0500 Subject: [PATCH] remind: replace use of deprecated `datetime.utcfromtimestamp()` --- sopel/modules/remind.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sopel/modules/remind.py b/sopel/modules/remind.py index 89dc76012..f35f77813 100644 --- a/sopel/modules/remind.py +++ b/sopel/modules/remind.py @@ -9,7 +9,7 @@ from __future__ import annotations import collections -from datetime import datetime +from datetime import datetime, timezone import io # don't use `codecs` for loading the DB; it will split lines on some IRC formatting import logging import os @@ -263,7 +263,7 @@ def remind_in(bot, trigger): timezone, trigger.nick, trigger.sender, - datetime.utcfromtimestamp(timestamp)) + datetime.fromtimestamp(timestamp, timezone.utc)) bot.reply('Okay, will remind at %s' % human_time) else: bot.reply('Okay, will remind in %s secs' % duration) @@ -495,7 +495,7 @@ def remind_at(bot, trigger): reminder.timezone.zone, trigger.nick, trigger.sender, - datetime.utcfromtimestamp(timestamp)) + datetime.fromtimestamp(timestamp, timezone.utc)) bot.reply('Okay, will remind at %s' % human_time) else: bot.reply('Okay, will remind in %s secs' % duration)