title: How can I set the ESP32's clock without access to the internet?
body: <p>Sorry if this is a noob question, but I've exhausted my research via <a href="http://www.cplusplus.com/reference/ctime/tm/" rel="nofollow noreferrer">http://www.cplusplus.com/reference/ctime/tm/</a> tutorials etc.</p>
  
  <p>I'm using the Arduino SimpleTime example for the ESP32, but would like to be able to set the time without internet access.</p>
  
  <p>I was using <code>TimeLib.h</code> for a past project which had a time setting functionality using a <code>setTime(Hour, Minute, Second, MDay, Mon, Year)</code> function, but that library and clock implementation seems to be susceptible to time advances as per Espressif issue #120: <a href="https://github.com/espressif/arduino-esp32/issues/120" rel="nofollow noreferrer">https://github.com/espressif/arduino-esp32/issues/120</a></p>
  
  <p>I've tested the SimpleTime sketch and haven't found any time advance drift due to ADC reads, so would like to be able to set up the ESP32 from bootup also in circumstances without internet access, and still be able to run with a time so I can use <code>time(NULL)</code>, <code>mktime(tm_struct)</code> etc.</p>
  
  <p>Is there a different implementation of <code>configTime(gmtOffset_sec, daylightOffset_sec, ntpServer)</code> which might work?</p>
  
  <p>Thanks in advance :)</p>