Bugfix if wallpaper time change between 23:00 and midnight

This commit is contained in:
2024-07-07 19:35:20 +02:00
parent 6afc62a87f
commit 8b9a708cb4

View File

@@ -137,6 +137,12 @@ class Suntimes:
hr += 1 hr += 1
min = 0 min = 0
hr = self.to_range(hr, 24)
try:
res = datetime(self.today.year, self.today.month, self.today.day, hr, int(min))
except:
print("Can not create datetime from %d.%d.%d %d:%d" % (self.today.year, self.today.month, self.today.day, hr, int(min)))
return
res = datetime(self.today.year, self.today.month, self.today.day, hr, int(min))
return res.replace(tzinfo=timezone.utc).astimezone(tz=None) return res.replace(tzinfo=timezone.utc).astimezone(tz=None)