NTP server and Daylight-saving status

Hi,
I am experimenting with 'ESP32 time' from the example library.
I would like to read a 'flag' from the ntpServer "uk.pool.ntp.org (UK)" that indicates if daylight-saving is in progress.
So that I can show this status on clock that I am designing.

I was thinking of something like:

If (daylight-saving is set)
Display " Summertime :20:34;56".

Else:
Display: GMT:"20:34;56".

Is this possible?
Regards

That would be the 'tm_isdst' field in the 'tm' structure (from time.h):

struct tm
{
  int	tm_sec;
  int	tm_min;
  int	tm_hour;
  int	tm_mday;
  int	tm_mon;
  int	tm_year;
  int	tm_wday;
  int	tm_yday;
  int	tm_isdst;
#ifdef __TM_GMTOFF
  long	__TM_GMTOFF;
#endif
#ifdef __TM_ZONE
  const char *__TM_ZONE;
#endif
};
1 Like

Hi,
Thank you very much.
I did not deduce that from the description.
I will try it out now.
Regards

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.