#-------------------------------------
# Modulo..: Actualiza RTC con tiempo desde Web
# Descrip.: Toma el tiempo desde web y actualiza el reloj interno
# -
#
# Version.: 1.0
# Ref.....: https://forums.raspberrypi.com/viewtopic.php?t=344043#p2061599
#
#
# Observ..: Busca la fecha y hora desde Internet
# - tiempo local
# - incluye cambios de horas
#
#-------------------------------------
import machine
rtc = machine.RTC()
print ('\n----- Inicia mdbRTC -----')
from funciones import *
from time import sleep, localtime
conWiFi()
#horaLocal(rtc)
print('------- nuevo intento ------')
print('\nmain> obtener hora de rtc.datetime....: ', getapitime())
print()
print('\nmain> obtener hora de rtc.datetime....: ', rtc.datetime())
print('main> pausa de 10 segundos')
sleep(10)
print()
print('main> nueva hora de rtc.datetime......: ', rtc.datetime())
print('main> hora desde time.localtime.......: ', localtime())
print('main> ojo! formato diferente entre localtime y datetime.\n')