#-------------------------------------
# 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
#
#-------------------------------------
#
from machine import RTC
import utime as time
from funciones import *
conWiFi()
print('\n------- Main ------')
print('main> obtener datos desde API')
getApiTime2()
# Verificar el tiempo actualizado
print('\n----- final -----')
print('main> obtener hora de rtc.datetime....: ', RTC().datetime())
print('main> hora desde time.localtime.......: ', time.localtime())
print('main> ojo! formato diferente entre localtime y datetime.\n')