From 924538f81ed9fdf879a327d61961fcaa730d1712 Mon Sep 17 00:00:00 2001 From: olamidepeterojo Date: Fri, 17 Jan 2025 08:56:52 +0100 Subject: [PATCH] Fix the deprecation status of the datetime library usage Signed-off-by: olamidepeterojo --- pagure_exporter/work/tkts.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pagure_exporter/work/tkts.py b/pagure_exporter/work/tkts.py index a89d5d3..a9e1707 100644 --- a/pagure_exporter/work/tkts.py +++ b/pagure_exporter/work/tkts.py @@ -22,7 +22,7 @@ import time -from datetime import datetime +from datetime import datetime, timezone import requests from gitlab import GitlabCreateError, GitlabGetError, GitlabUpdateError @@ -199,12 +199,12 @@ def itercmts(self, dictobjc): issulink=standard.issulink, reponame=standard.srcename, repolink=standard.srcedict["repolink"], - dateinfo=datetime.utcfromtimestamp(standard.cmtstime).strftime("%c"), - mo=datetime.utcfromtimestamp(standard.cmtstime).strftime("%b").lower(), - dd=datetime.utcfromtimestamp(standard.cmtstime).strftime("%d"), - yy=datetime.utcfromtimestamp(standard.cmtstime).strftime("%Y"), - hh=datetime.utcfromtimestamp(standard.cmtstime).strftime("%H"), - mm=datetime.utcfromtimestamp(standard.cmtstime).strftime("%M"), + dateinfo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%c"), + mo=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%b").lower(), + dd=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%d"), + yy=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%Y"), + hh=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%H"), + mm=datetime.fromtimestamp(standard.cmtstime, timezone.utc).strftime("%M"), ) """ Replace "@" in the `bodydata` with "&" to ensure that wrong people are not referenced