From 60e3eeae48c5b65ee707bb9db6ca540fa07b7bdc Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Wed, 27 Apr 2022 12:16:54 -0700 Subject: [PATCH] Specify timezone when doing conversion in seen module --- sopel/modules/seen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sopel/modules/seen.py b/sopel/modules/seen.py index fa9461047b..a38efb753f 100644 --- a/sopel/modules/seen.py +++ b/sopel/modules/seen.py @@ -11,6 +11,7 @@ import datetime import time +import pytz from sopel import plugin from sopel.tools.time import seconds_to_human @@ -40,7 +41,7 @@ def seen(bot, trigger): message = bot.db.get_nick_value(nick, 'seen_message') action = bot.db.get_nick_value(nick, 'seen_action') - saw = datetime.datetime.utcfromtimestamp(timestamp) + saw = datetime.datetime.fromtimestamp(timestamp, pytz.utc) delta = seconds_to_human((trigger.time - saw).total_seconds()) msg = "I last saw " + nick