Calculando el proximo lunes
This commit is contained in:
+1
-1
Submodule python-utilities updated: 346053e0f3...db4441c4d5
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user