Calculando el proximo lunes

This commit is contained in:
2025-03-10 07:28:38 +01:00
parent db4441c4d5
commit e011ba6a8e
2 changed files with 3 additions and 3 deletions
Submodule python-utilities updated: 346053e0f3...db4441c4d5
+2 -2
View File
@@ -104,7 +104,7 @@ async def manejar_respuesta(update: Update, context: CallbackContext):
def next_monday(): def next_monday():
# Obtener la fecha actual # Obtener la fecha actual
hoy = datetime.now() hoy = datetime.datetime.now(TIMEZONE)
# Calcular cuántos días faltan para el próximo lunes # Calcular cuántos días faltan para el próximo lunes
# weekday() devuelve 0 para lunes, 1 para martes, ..., 6 para domingo # 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)) application.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, manejar_respuesta))
# Programar el mensaje de guardia # 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 = next_monday() #ahora #+ datetime.timedelta(days=(0 - ahora.weekday()))
proximo_lunes = proximo_lunes.replace(hour=8, minute=25, second=0, microsecond=0) proximo_lunes = proximo_lunes.replace(hour=8, minute=25, second=0, microsecond=0)