Attempt to work around timezones

This commit is contained in:
2023-09-24 23:47:09 +02:00
parent b0f76f4c49
commit 3fa2f5a800
13 changed files with 99 additions and 36 deletions

View File

@@ -11,6 +11,7 @@ from classes.pyroclient import PyroClient
from modules import custom_filters
from modules.search_name import search_name
from modules.search_nearby import search_nearby
from modules.utils import from_utc
logger = logging.getLogger(__name__)
@@ -73,9 +74,10 @@ async def command_setup(app: PyroClient, message: Message):
await user.update_location(location.id)
user_time = datetime(1970, 1, 1, user.time_hour, user.time_minute).strftime(
app._("time", "formats", locale=user.locale)
)
user_time = from_utc(
datetime(1970, 1, 1, user.time_hour, user.time_minute),
None if user.location is None else user.location.timezone.zone,
).strftime(app._("time", "formats", locale=user.locale))
await message.reply_text(
app._("setup_finished", "messages", locale=user.locale).format(