If your question is: how do I set the time on a board without network connection
The simplest way (nowadays) is using mpremote
mpremote
is a MicroPython utility that you can install to your PC, that has a command to set the MCU time to that of your PC.
The requirement is that the MCU is connection via serial, (and that nothing else uses that port at the same time)
Install mpremote : pip install -U mpremote
PS C:\develop\MyPython\> mpremote setrtc repl
Connected to MicroPython at COM14
Use Ctrl-] to exit this shell
>
MicroPython v1.19.1 on 2022-06-18; ESP32S3 module with ESP32S3
Type "help()" for more information.
>>> import time
>>> time.localtime()
(2020, 1, 1, 10, 0, 17, 2, 1)
here mpremote
autodetects the first device, connects to that, sets the time, and enters the MicroPython repl
more info: https://docs.micropython.org/en/latest/reference/mpremote.html
and