From 64034ff9425f15b365f38e573e02696ffbe3bfd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Fri, 10 Jul 2020 19:16:05 +0200 Subject: [PATCH] timestamp: fix date and time when adding an hour --- modules/timestamp.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/timestamp.py b/modules/timestamp.py index e06a7e7..f667ac1 100644 --- a/modules/timestamp.py +++ b/modules/timestamp.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timedelta def timestamp_str(): @@ -17,5 +17,7 @@ def timestamp_str(): else: minute = "00" hour += 1 + hour %= 24 + now += timedelta(hours=1) return now.strftime("%a, %d.%m ") + "{}:{}".format(hour, minute) -- 2.44.0