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)
-
have you checked in the library for documentation?jsotola– jsotola2020年01月15日 22:13:37 +00:00Commented Jan 15, 2020 at 22:13
1 Answer 1
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
-
So, time.h is not where
configTime(...)
is defined then?John F. Miller– John F. Miller2020年01月15日 22:12:07 +00:00Commented Jan 15, 2020 at 22:12 -
2No.
configTime()
is part of the ESP32 core. github.com/espressif/arduino-esp32/blob/master/cores/esp32/…Majenko– Majenko2020年01月15日 22:13:41 +00:00Commented Jan 15, 2020 at 22:13