Copyright ©

Mongoose OS Forum


Getting Epoch vs Time Since Boot in C

djcarlinwadjcarlinwa Seattle, WA USA

Objective: Time of Day on ESP32 in C

In C, is it necessary to explicitly call sntp init and set up the call backs? I have sntp enabled with google time, etc but all time values I try are based on time since boot.

Please point me to an example in C of getting the Epoch value.

Thank you for great software!


  • nliviunliviu Romania
    edited March 13

    You only have to add the sntp library to your mos.yml and configure the wifi to connect to an access point in order to have an internet connection.
    The default sntp server is If you want to use other server, just add in the config_schema section

     - ["sntp.server", "your_sntp_server"]


Sign In or Register to comment.