1

I am working from the example sketch in that installed with the ESP32 Dev Module into the Arduino IDE. It includes <WiFi.h> and "time.h". I have a number of questions about how to use the clock that is set up with configTime using NTP. I am trying to find the documentation, but I'm having difficulty identifying exactly who is providing me the "time.h" header file, and of course, there are a lot of different time.h header files out there so googling is difficult.

Where can I find the documentation for this particular header?


Example questions:

  • Can the time be set manually without a WiFi connection?
  • Can the timezone be changed without connecting to NTP again?
  • Can I get the time as a Unix Time Stamp? (Yes)
  • Can I arrange for a function callback at a certain time? (I'm aware I can use the timer library for this but I'm hoping for something like a callback at 4:20p every Saturday)
John F. Miller
  • 135
  • 1
  • 2
  • 9

1 Answers1

3

time.h is provided by the compiler (more specifically the C library in use in the compiler).

I believe the xtensa-esp32 compiler uses newlib as the C library. If that is the case, the documentation is here: https://sourceware.org/newlib/libc.html#Timefns

Majenko
  • 105,851
  • 5
  • 82
  • 139