Yet another timezones fix

This commit is contained in:
2023-10-15 22:21:10 +02:00
parent 192602471b
commit 842218859c
2 changed files with 25 additions and 5 deletions

View File

@@ -55,9 +55,12 @@ async def command_set_time(app: PyroClient, message: Message):
break
now = datetime.now()
parsed_time = datetime.strptime(answer.text, "%H:%M").replace(
year=1970, month=1, day=1, second=0, microsecond=0
year=now.year, month=now.month, day=now.day, second=0, microsecond=0
)
user_time = to_utc(parsed_time, user.location.timezone.zone)
await user.update_time(hour=user_time.hour, minute=user_time.minute)