Bugfix if wallpaper time change between 23:00 and midnight
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user