SimpleTime.ino question
Posted: Fri Aug 09, 2019 12:06 pm
Dear Sirsm
I am making my first steps in ESP32 running with the Arduino IDE. I found an example that using the time.h internal library, you can have ntp time. The example is: SimpleTime.ino
My problem is I can not understood one commant that this SimpleTime.ino is using, more precicely:
What it does the part of the Serial.println (&timeinfo, "%A, %B %d %Y %H:%M:%S") ? From where are getting the %A %B etc ?
Looking at the time.h there are not these references %A %B etc etc.
Please for someone that can help me to understand...
Thanks and Best Regards,
Mike Kranidis
I am making my first steps in ESP32 running with the Arduino IDE. I found an example that using the time.h internal library, you can have ntp time. The example is: SimpleTime.ino
My problem is I can not understood one commant that this SimpleTime.ino is using, more precicely:
Code: Select all
[void printLocalTime()
{
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
Serial.println(&timeinfo, "%A, %B %d %Y %H:%M:%S");
}/code]
while in setup section there is:
[code]
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
Looking at the time.h there are not these references %A %B etc etc.
Please for someone that can help me to understand...
Thanks and Best Regards,
Mike Kranidis