thank you, as far as I can see one has to config a tcr (which is Berlin?) and then it might work.
But how can the program also get the tcr automatically, from the standpoint of my WiFi connection (retrieve and evaluate internet IP)? Similar to how a Raspberry Pi or a Windows PC automatically shows the correct local time incl. summer/winter time-shift?
That is correct. These have to be manually configured with your time zone rules. What you appear to want is a location based service. I can't help there.
A trick that I use, is if there’s a cellular connection available, scrape the date & time from the cell network…
It’s localised to wherever you’re connected.
what do you mean by "cellular connection available"?
a WiFi connection to an Android smartphone?
No, there isn't, all I have is an internet connection to the router in my house and a dynamic url and the esp creates a website then with html buttons and tables (WifiServer/Webserver)
thank you, but the esp example doesn't compile, appearently configTime() is incompatible.
My configTime is configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
whilst the author of your example uses
error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
#define MY_TZ "CET-1CEST,M3.5.0/02,M10.5.0/03"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\abcd\Desktop\sketch_dec23a\sketch_dec23a.ino:64:14: note: in expansion of macro 'MY_TZ'
configTime(MY_TZ, MY_NTP_SERVER); // --> Here is the IMPORTANT ONE LINER needed in your sketch!
^~~~~
sketch_dec23a:25:25: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
#define MY_NTP_SERVER "pool.ntp.org"
^~~~~~~~~~~~~~
C:\Users\abcd\Desktop\sketch_dec23a\sketch_dec23a.ino:64:21: note: in expansion of macro 'MY_NTP_SERVER'
configTime(MY_TZ, MY_NTP_SERVER); // --> Here is the IMPORTANT ONE LINER needed in your sketch!
^~~~~~~~~~~~~
sketch_dec23a:64:34: error: too few arguments to function 'void configTime(long int, int, const char*, const char*, const char*)'
configTime(MY_TZ, MY_NTP_SERVER); // --> Here is the IMPORTANT ONE LINER needed in your sketch!
^
and tbh, unfortunately I don't understand this line at all: #define MY_TZ "CET-1CEST,M3.5.0/02,M10.5.0/03"
OTOH, for ipgeolocation there is no example .ino sketch at all...
char *buffer[80];
time(&now); // read the current time
localtime_r(&now, &tm); // update the structure tm with the current time
strftime (buffer,80,"%a %d %b %Y %H:%M:%S ", &tm);
Serial.print(buffer);