Calculando el proximo lunes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user