From e011ba6a8e92bccfc8fe3920ad081ba79855ebf4 Mon Sep 17 00:00:00 2001 From: JJ Date: Mon, 10 Mar 2025 07:28:38 +0100 Subject: [PATCH] Calculando el proximo lunes --- python-utilities | 2 +- telegram-bot-guardias.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python-utilities b/python-utilities index 346053e..db4441c 160000 --- a/python-utilities +++ b/python-utilities @@ -1 +1 @@ -Subproject commit 346053e0f3e905864d36f0b64835358db92c5bde +Subproject commit db4441c4d570704c9b5d7b1c397644f649180e4c diff --git a/telegram-bot-guardias.py b/telegram-bot-guardias.py index 1ea9394..96e90ba 100644 --- a/telegram-bot-guardias.py +++ b/telegram-bot-guardias.py @@ -104,7 +104,7 @@ async def manejar_respuesta(update: Update, context: CallbackContext): def next_monday(): # Obtener la fecha actual - hoy = datetime.now() + hoy = datetime.datetime.now(TIMEZONE) # Calcular cuántos días faltan para el próximo lunes # weekday() devuelve 0 para lunes, 1 para martes, ..., 6 para domingo @@ -127,7 +127,7 @@ def main(): application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, manejar_respuesta)) # Programar el mensaje de guardia - #ahora = datetime.datetime.now(TIMEZONE) + ahora = datetime.datetime.now(TIMEZONE) proximo_lunes = next_monday() #ahora #+ datetime.timedelta(days=(0 - ahora.weekday())) proximo_lunes = proximo_lunes.replace(hour=8, minute=25, second=0, microsecond=0)