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
+2 -2
View File
@@ -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)