Six sections were added to the programs to get the date and time corrected for time zone and daylight or standard time. Internet time and date is used to set the DS3231 battery backed real time clock once a day at 3 a.m. Most NTP servers give UTC time only and you have to correct for time zone and daylight savings or standard time yourself. This code makes it easy.

All of my remote home automation controllers use web pages as the HMI instead of local displays.

Programs are also uploaded wirelessly as well.

initialize
//***********NTP time intialize 1 of 6********************************************************
#include "time.h" 

const char* Timezone = "EST5EDT,M3.2.0,M11.1.0"; // EST USA corrects for DST  
String Date_str, Time_str, Time_format, Year_str, Month_str, Day_str, Hour_str, Min_str, Sec_str;
int Year_integer, Month_integer, Day_integer, Hour_integer, Min_integer, Sec_integer;
//********** end NTP time intialize***********************************************************

bottom of setup

//********** NTP time setup 2 of 6***********************************************    

   configTime(0, 0, "pool.ntp.org", "time.nist.gov");
    setenv("TZ", Timezone, 1);
    Time_format = "I"; // or StartTime("I"); 
//***********end NTP time setup***********************************************  

in loop

only run once every second. 

//********** NTP time loop 3 of 6***********************************************  

     UpdateLocalTime(Time_format);
//***********end NTP time loop*************************************************  

If also using RTC only update time and set RTC early in the morning. If you have many devices pick different times to update each of them. I had router issues updating every second at the same time on many devices.

//****Auto RTC time set from internet time 4 of 6************************************ if ((t.Hour() == 3) && (t.Minute() == 0) && (t.Second() == 30))  {  RtcDateTime t = RtcDateTime(Year_integer, Month_integer, Day_integer, Hour_integer, Min_integer, Sec_integer); //set date and time hour, min, sec from internet  Rtc.SetDateTime(t); //configure the RTC with object  }    

 //****end Auto RTC time set from internet time**************************************

below data print on web page

 //**************NTP time print time to web page 5 of 6*********************************
  client.println(Date_str);
  client.println(Time_str);

  client.println(Hour_integer);
  client.println(Min_integer);
  client.println(Sec_integer);
//***************end NTP print time*****************************************

below program

//6 of 6 ###################################################################################
void UpdateLocalTime(String Format){
  time_t now;
  time(&now);
  //See http://www.cplusplus.com/reference/ctime/strftime/
  char hour_output[30], day_output[30];
    strftime(day_output, 30, "%a  %m-%d-%y", localtime(&now)); // Formats date as: Sat Jun-24-17
    strftime(hour_output, 30, "%T", localtime(&now));          // Formats time as: 2:05:49pm
     Date_str = day_output;
     Time_str = hour_output;

 //*** parse date and time string to get individual date and time integers to set RTC 
   
       strftime(day_output, 30, "%C", localtime(&now));          
     Year_str = day_output;
     Year_integer = Year_str.toInt();
     
      strftime(day_output, 30, "%m", localtime(&now));          
     Month_str = day_output;
     Month_integer = Month_str.toInt();
     
      strftime(day_output, 30, "%e", localtime(&now));      ...

Read more »