Reloj y contador de suscriptores esp8266wifi

Buenas tardes .Estoy con el código de contador de suscriptores pero no consigo poner la hora actualizada de España ,me es imposible poner por ejemplo las 19:30.voy a mostrar el código a ver si me lo podeis solucionar .Muchas gracias.

/*`Texto preformateado`
  Code for the video:
  https://youtu.be/bePgZIXHSkM
  (c)2017 Pawel A. Hernik
 
  ESP-01 pinout:

  GPIO 2 - DataIn
  GPIO 1 - LOAD/CS
  GPIO 0 - CLK

  ------------------------
  NodeMCU 1.0 pinout:

  D8 - DataIn
  D7 - LOAD/CS
  D6 - CLK
*/


#include "Arduino.h"
#include <ESP8266WiFi.h>
#include <ArduinoJson.h>

#define NUM_MAX 4
#define ROTATE 90

// for ESP-01 module
//#define DIN_PIN 2 // D4
//#define CS_PIN  3 // D9/RX
//#define CLK_PIN 0 // D3

// for NodeMCU 1.0
#define DIN_PIN 15  // D8
#define CS_PIN  13  // D7
#define CLK_PIN 12  // D6

#include "max7219.h"
#include "fonts.h"

// =======================================================================
// Your config below!
// =======================================================================
const char* ssid     = "";               // SSID of local network
const char* password = "";             // Password on network
String ytApiV3Key = "";                // YouTube Data API v3 key generated here: https://console.developers.google.com
String channelId = "";   // YT channel id
long utcOffset = 1;//GMT+1                              // for Madrid,spain
// =======================================================================

void setup() 
{
  Serial.begin(115200);
  initMAX7219();
  sendCmdAll(CMD_SHUTDOWN,1);
  sendCmdAll(CMD_INTENSITY,0);
  Serial.print("Connecting WiFi ");
  WiFi.begin(ssid, password);
  printStringWithShift(" WiFi ...~",15,font,' ');
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print("."); delay(500);
  }
  Serial.println("");
  Serial.print("Connected: "); Serial.println(WiFi.localIP());
  Serial.println("Getting data ...");
  printStringWithShift(" YT ...~",15,font,' ');
}
// =======================================================================

long viewCount, viewCount24h=-1, viewsGain24h;
long subscriberCount, subscriberCount1h=-1, subscriberCount24h=-1, subsGain1h=0, subsGain24h=0;
long videoCount;
int cnt = 0;
unsigned long time1h, time24h;
long localEpoc = 0;
long localMillisAtUpdate = 0;
int h, m, s;
String date;

void loop()
{
  if(cnt<=0) {
    if(getYTData()==0) {
      cnt = 1;  // data is refreshed every 50 loops
      if(subscriberCount1h<0) {
        time1h = time24h = millis();
        subscriberCount1h = subscriberCount24h = subscriberCount;
        viewCount24h = viewCount;
      }
      if(millis()-time1h>1000*60*60) {
        time1h = millis();
        subscriberCount1h = subscriberCount;
      }
      if(millis()-time24h>1000*60*60*24) {
        time24h = millis();
        subscriberCount24h = subscriberCount;
        viewCount24h = viewCount;
      }
      subsGain1h = subscriberCount-subscriberCount1h;
      subsGain24h = subscriberCount-subscriberCount24h;
      viewsGain24h = viewCount-viewCount24h;
    }
  }
  cnt--;
  updateTime();
  int del = 3000;
  int scrollDel = 20;
  char txt[10];
  sprintf(txt,"    %02d:%02d  ",h,m);
  printStringWithShift(txt,scrollDel,font,' '); // real time
  delay(del);
  
  printStringWithShift("  Subscribers: ",scrollDel,font,' '); // eng
  //printStringWithShift("  Subskrybcje: ",scrollDel,font,' '); // pol
  printValueWithShift(subscriberCount,scrollDel,0);
  delay(del);
  if(subsGain1h) {
    printStringWithShift("  Subscribers gain 1h: ",scrollDel,font,' '); // eng
    //printStringWithShift("  Przyrost subskrybcji 1h: ",scrollDel,font,' '); // pol
    printValueWithShift(subsGain1h,scrollDel,1);
    delay(del);
  }
  if(subsGain24h) {
    printStringWithShift("  Subscribers gain 24h: ",scrollDel,font,' '); // eng
    //printStringWithShift("  Przyrost subskrybcji 24h: ",scrollDel,font,' '); // pol
    printValueWithShift(subsGain24h,scrollDel,1);
    delay(del);
  }
  printStringWithShift("  Views: ",scrollDel,font,' '); // eng
  //printStringWithShift("  Wyświetlenia: ",scrollDel,font,' '); // pol
  printValueWithShift(viewCount,scrollDel,0);
  delay(del);
  if(viewsGain24h) {
    printStringWithShift("  Subscribers gain 24h: ",scrollDel,font,' '); // eng
    //printStringWithShift("  Przyrost wyświetleń 24h: ",scrollDel,font,' '); // pol
    printValueWithShift(subsGain24h,scrollDel,1);
    delay(del);
  }
  printStringWithShift("  Videos: ",scrollDel,font,' '); // eng
  //printStringWithShift("  Filmy: ",scrollDel,font,' '); // pol
  printValueWithShift(videoCount,scrollDel,0);
  delay(del);
}
// =======================================================================

int dualChar = 0;

unsigned char convertPolish(unsigned char _c)
{
  unsigned char c = _c;
  if(c==196 || c==197 || c==195) {
    dualChar = c;
    return 0;
  }
  if(dualChar) {
    switch(_c) {
      case 133: c = 1+'~'; break; // 'ą'
      case 135: c = 2+'~'; break; // 'ć'
      case 153: c = 3+'~'; break; // 'ę'
      case 130: c = 4+'~'; break; // 'ł'
      case 132: c = dualChar==197 ? 5+'~' : 10+'~'; break; // 'ń' and 'Ą'
      case 179: c = 6+'~'; break; // 'ó'
      case 155: c = 7+'~'; break; // 'ś'
      case 186: c = 8+'~'; break; // 'ź'
      case 188: c = 9+'~'; break; // 'ż'
      //case 132: c = 10+'~'; break; // 'Ą'
      case 134: c = 11+'~'; break; // 'Ć'
      case 152: c = 12+'~'; break; // 'Ę'
      case 129: c = 13+'~'; break; // 'Ł'
      case 131: c = 14+'~'; break; // 'Ń'
      case 147: c = 15+'~'; break; // 'Ó'
      case 154: c = 16+'~'; break; // 'Ś'
      case 185: c = 17+'~'; break; // 'Ź'
      case 187: c = 18+'~'; break; // 'Ż'
      default:  break;
    }
    dualChar = 0;
    return c;
  }    
  switch(_c) {
    case 185: c = 1+'~'; break;
    case 230: c = 2+'~'; break;
    case 234: c = 3+'~'; break;
    case 179: c = 4+'~'; break;
    case 241: c = 5+'~'; break;
    case 243: c = 6+'~'; break;
    case 156: c = 7+'~'; break;
    case 159: c = 8+'~'; break;
    case 191: c = 9+'~'; break;
    case 165: c = 10+'~'; break;
    case 198: c = 11+'~'; break;
    case 202: c = 12+'~'; break;
    case 163: c = 13+'~'; break;
    case 209: c = 14+'~'; break;
    case 211: c = 15+'~'; break;
    case 140: c = 16+'~'; break;
    case 143: c = 17+'~'; break;
    case 175: c = 18+'~'; break;
    default:  break;
  }
  return c;
}

// =======================================================================

int charWidth(char ch, const uint8_t *data)
{
  int len = pgm_read_byte(data);
  return pgm_read_byte(data + 1 + ch * len);
}

// =======================================================================

int showChar(char ch, const uint8_t *data)
{
  int len = pgm_read_byte(data);
  int i,w = pgm_read_byte(data + 1 + ch * len);
  scr[NUM_MAX*8] = 0;
  for (i = 0; i < w; i++)
    scr[NUM_MAX*8+i+1] = pgm_read_byte(data + 1 + ch * len + 1 + i);
  return w;
}

// =======================================================================

void printCharWithShift(unsigned char c, int shiftDelay, const uint8_t *data, int offs) 
{
  c = convertPolish(c);
  if(c < offs || c > MAX_CHAR) return;
  c -= offs;
  int w = showChar(c, data);
  for (int i=0; i<w+1; i++) {
    delay(shiftDelay);
    scrollLeft();
    refreshAll();
  }
}

// =======================================================================

void printStringWithShift(const char *s, int shiftDelay, const uint8_t *data, int offs)
{
  while(*s) printCharWithShift(*s++, shiftDelay, data, offs);
}

// =======================================================================
// printValueWithShift():
// converts int to string
// centers string on the display
// chooses proper font for string/number length
// can display sign - or +
void printValueWithShift(long val, int shiftDelay, int sign)
{
  const uint8_t *digits = digits5x7;       // good for max 5 digits
  if(val>1999999) digits = digits3x7;      // good for max 8 digits
  else if(val>99999) digits = digits4x7;   // good for max 6-7 digits
  String str = String(val);
  if(sign) {
    if(val<0) str=";"+str; else str="<"+str;
  }
  const char *s = str.c_str();
  int wd = 0;
  while(*s) wd += 1+charWidth(*s++ - '0', digits);
  wd--;
  int wdL = (NUM_MAX*8 - wd)/2;
  int wdR = NUM_MAX*8 - wdL - wd;
  //Serial.println(wd); Serial.println(wdL); Serial.println(wdR);
  s = str.c_str();
  while(wdL>0) { printCharWithShift(':', shiftDelay, digits, '0'); wdL--; }
  while(*s) printCharWithShift(*s++, shiftDelay, digits, '0');
  while(wdR>0) { printCharWithShift(':', shiftDelay, digits, '0'); wdR--; }
}

// =======================================================================

const char *ytHost = "www.googleapis.com";

int getYTData()
{
  WiFiClientSecure client;
  Serial.print("connecting to "); Serial.println(ytHost);
  if (!client.connect(ytHost, 443)) {
    Serial.println("connection failed");
    return -1;
  }
  String cmd = String("GET /youtube/v3/channels?part=statistics&id=") + channelId + "&key=" + ytApiV3Key+ " HTTP/1.1\r\n" +
                "Host: " + ytHost + "\r\nUser-Agent: ESP8266/1.1\r\nConnection: close\r\n\r\n";
  client.print(cmd);

  int repeatCounter = 10;
  while (!client.available() && repeatCounter--) {
    Serial.println("y."); delay(500);
  }
  String line,buf="";
  int startJson=0, dateFound=0;
  while (client.connected() && client.available()) {
    line = client.readStringUntil('\n');
    if(line[0]=='{') startJson=1;
    if(startJson) {
      for(int i=0;i<line.length();i++)
        if(line[i]=='[' || line[i]==']') line[i]=' ';
      buf+=line+"\n";
    }
    if(!dateFound && line.startsWith("Date: ")) {
      dateFound = 1;
      date = line.substring(6, 22);
      h = line.substring(23, 25).toInt();
      m = line.substring(26, 28).toInt();
      s = line.substring(29, 31).toInt();
      localMillisAtUpdate = millis();
      localEpoc = (h * 60 * 60 + m * 60 + s);
    }
  }
  client.stop();

  DynamicJsonBuffer jsonBuf;
  JsonObject &root = jsonBuf.parseObject(buf);
  if (!root.success()) {
    Serial.println("parseObject() failed");
    printStringWithShift("json error!",30,font,' ');
    delay(10);
    return -1;
  }
  viewCount       = root["items"]["statistics"]["viewCount"];
  subscriberCount = root["items"]["statistics"]["subscriberCount"];
  videoCount      = root["items"]["statistics"]["videoCount"];
  return 0;
}

// =======================================================================

void updateTime()
{
  long curEpoch = localEpoc + ((millis() - localMillisAtUpdate) / 1000);
   long epoch = round(curEpoch + 3600 * utcOffset + 86400L);
  h = ((epoch  % 86400L) / 3600) % 24;
  m = (epoch % 3600) / 60;
  s = epoch % 60;
}

// =======================================================================

Ese código tiene 7 años, así que hay dos caminos o vas por algo mas moderno o usas un IDE y liberías de la época y no tendrás problemas.

Yo te voy a poner un código que hice/adapté para un OLED, pero tiene la posibilidad de cambio de horar Verano/Invierno que no usamos en Argentina pero se que si usa España.
Todo esta para Argentina e incluso el cambio de hora esta desactivado porque ambos estan en el mismo día.

#include <Arduino.h>

#include <NTPClient.h>
// change next line to use with another board/shield
#include <WiFi.h>
// #include <WiFi.h> // for WiFi shield
// #include <WiFi101.h> // for WiFi 101 shield or MKR1000
#include <WiFiUdp.h>

WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);

#include <Timezone.h> // https://github.com/JChristensen/Timezone
TimeChangeRule* tcr;
TimeChangeRule tcr1 = { "tcr1", First, Sun, Oct, 3, -180 };  // standard/winter time, valid from last sunday of october at 3am, UTC + 1 hour (+60 minutes) (negative value like -300 for utc -5h)
TimeChangeRule tcr2 = { "tcr2", Second, Sun, Mar, 2, -180 }; // daylight/summer time, valid from last sunday of march at 2am, UTC + 2 hours (+120 minutes)
//-----------------------------------------------
Timezone myTimeZone(tcr1, tcr2);

unsigned long startTime, updateNTPTime;
int x;
int pass = 0;

#include <WiFiManager.h>
const bool useWPS = false; // set to false to disable WPS and use credentials below - no wps on lazy words!

#include <Adafruit_GFX.h>       // librería de Adafruit
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED width,  in pixels
#define SCREEN_HEIGHT 64 // OLED height, in pixels

// create an OLED display object connected to I2C
Adafruit_SSD1306 oled(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

bool flag = false;

void setup()
{
  Serial.begin(115200);

  // initialize OLED display with I2C address 0x3C
  if (!oled.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
    Serial.println(F("failed to start SSD1306 OLED"));
    while (1);
  }
  delay(2000);         // wait two seconds for initializing
  oled.clearDisplay(); // clear display

  oled.setTextSize(1);         // set text size
  oled.setTextColor(WHITE); // setTextColor    // set text color
  oled.setCursor(0, 10);       // set position to display
  oled.println("OLED iniciado"); // set text
  oled.display();              // display on OLED


  Wire.begin(21, 22);   // sda= GPIO_21 /scl= GPIO_22

  WiFi.mode(WIFI_STA); // set WiFi mode to STA...
  if (useWPS) {
    WiFi.begin(WiFi.SSID().c_str(), WiFi.psk().c_str()); // ...and start connecting using saved credentials...
  }

  WiFiManager wm;

  // wm.resetSettings();
  bool res = wm.autoConnect("Shabat_Wifi", "12346578"); // password protected ap
  if (!res) {
    Serial.println("Falla de conexion");
    // ESP.restart();
  } else {
    //if you get here you have connected to the WiFi    
    Serial.println("Conectado!!");
  }
  WiFi.setSleep(false);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println("WiFi connected");

  Serial.print(WiFi.localIP());
  Serial.println("' to connect");
  // Connect to Wi-Fi
  oled.setCursor(0, 10);       // set position to display
  oled.println("Conectando a"); // set text
  Serial.print("Conectando a ");
  Serial.println(WiFi.SSID());
  oled.setCursor(0, 20);       // set position to display
  oled.println(WiFi.SSID());
  oled.display();              // display on OLED

  timeClient.begin();


  Serial.println("Iniciado.");
  timeClient.update();
}

void loop() {
  char buffer [9];

  if (millis() - updateNTPTime > 300000UL) {
    timeClient.update();
    updateNTPTime = millis();
  }
  unsigned long epochTime = timeClient.getEpochTime();

  // convert received time stamp to time_t object
  time_t utc = now();
  utc = epochTime;

  if (millis() - startTime > 1000UL) {
    // sprintf(buffer, "%2d:%2d", timeClient.getHours(), timeClient.getMinutes());

    TimeChangeRule* tcr; // pointer to the time change rule, use to get the TZ abbrev
    time_t t = myTimeZone.toLocal(utc, &tcr);
    char buf [30];
    sprintf(buf, "Hora full: %.2d:%.2d:%.2d ", hour(t), minute(t), second(t));
    Serial.println(buf);
    oled.print(buf);
    sprintf(buffer, "%.2d:%.2d", hour(t), minute(t));
    Serial.println(buffer);
    startTime = millis();
  }

  delay(50);     // modificamos el tiempo de retardo de acuerdo a la preferencia
}

Si quitas lo que corresponde a OLED y adaptas lo que usas con el MAX7219, tendrás algo funcional.
Si tienes problemas te puedo ir guiando. Ahora es tarde acá como para ver como hacerlo.

Gracias.Yo lo que quiero es compilar ese código con este otro (ntp client2 clock)este reloj si va bien y lo quiero unir con el codigo de contador de suscriptores pero no lo consigo .a ver que podemos hacer .este es el código que va bien la hora.

/*
  ESP-01 pinout from top:
  
  GND    GP2 GP0 RX/GP3
  TX/GP1 CH  RST VCC

  MAX7219
  ESP-1 from rear
  Re Br Or Ye
  Gr -- -- --

  USB to Serial programming
  ESP-1 from rear, FF to GND, RR to GND before upload
  Gr FF -- Bl
  Wh -- RR Vi

  GPIO 2 - DataIn
  GPIO 1 - LOAD/CS
  GPIO 0 - CLK

  ------------------------
  NodeMCU 1.0 pinout:

  D8 - DataIn
  D7 - LOAD/CS
  D6 - CLK
  
*/


#include "Arduino.h"
#include <ESP8266WiFi.h>


WiFiClient client;

String date;

#define NUM_MAX 8

// for ESP-01 module
//#define DIN_PIN 2 // D4
//#define CS_PIN  3 // D9/RX
//#define CLK_PIN 0 // D3

// for NodeMCU 1.0
#define DIN_PIN 15  // D8
#define CS_PIN  13  // D7
#define CLK_PIN 12  // D6



#include "max7219.h"
#include "fonts.h"

// =======================================================================
// CHANGE YOUR CONFIG HERE:
// =======================================================================
const char* ssid     = "";     // SSID of local network
const char* password = "";   // Password on network

// =======================================================================

void setup() 
{
  Serial.begin(115200);
  initMAX7219();
  sendCmdAll(CMD_SHUTDOWN,1);
  sendCmdAll(CMD_INTENSITY,0);
  Serial.print("Connecting WiFi ");
  WiFi.begin(ssid, password);
  printStringWithShift("Connecting...... ",25);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected: "); Serial.println(WiFi.localIP());
}
// =======================================================================
#define MAX_DIGITS 16
byte dig[MAX_DIGITS]={0};
byte digold[MAX_DIGITS]={0};
byte digtrans[MAX_DIGITS]={0};
int updCnt = 0;
int dots = 0;
long dotTime = 0;
long clkTime = 0;
int dx=0;
int dy=0;
byte del=0;
int h,m,s;
// =======================================================================
void loop()
{
  if(updCnt<=0) 
  { 
    updCnt = 10;  // every 10 scrolls, ~450s=7.5m
    Serial.println("Getting data...");
    printStringWithShift("Getting data....",25);  // 25    SPEED
    getTime();
    Serial.println("Data loaded");
    clkTime = millis();
  }
 
  if(millis()-clkTime > 120000 && !del && dots) // clock for 40s, then scrolls for about 30s
  { 
    printStringWithShift(date.c_str(),75);
   delay(10000);
   printStringWithShift("                    .HRB Embedded.",75);
   delay(3000);
    updCnt--;
    clkTime = millis();
  }
    if(millis()-dotTime > 500) 
  {
    dotTime = millis();
    dots = !dots;
  }
  updateTime();
  showAnimClock();
  
 }

// =======================================================================

void showSimpleClock()
{
  dx=dy=0;
  clr();
  showDigit(h/10,  1, dig6x8);
  showDigit(h%10,  9, dig6x8);
  showDigit(m/10, 18, dig6x8);
  showDigit(m%10, 26, dig6x8);
  showDigit(s/10, 49, dig6x8);
  showDigit(s%10, 49, dig6x8);
  setCol(16,dots ? B00100100 : 0);
  setCol(33,dots ? B00100100 : 0);
  refreshAll();
}

// =======================================================================

void showAnimClock()
{
  byte digPos[6]={1,8,18,25,41,49};
  int digHt = 12;
  int num = 6; 
  int i;
  if(del==0) {
    del = digHt;
    for(i=0; i<num; i++) digold[i] = dig[i];
    if(h>12)
   {
    h=h-12;
    }
    dig[0] = h/10 ? h/10 : 10;
    dig[1] = h%10;
    dig[2] = m/10;
    dig[3] = m%10;
    dig[4] = s/10;
    dig[5] = s%10;
    for(i=0; i<num; i++)  digtrans[i] = (dig[i]==digold[i]) ? 0 : digHt;
  } else
    del--;
  
  clr();
  
  for(i=0; i<num; i++) {
    if(digtrans[i]==0) {
      dy=0;
      showDigit(dig[i], digPos[i], dig6x8);
    } else {
      dy = digHt-digtrans[i];
      showDigit(digold[i], digPos[i], dig6x8);
      dy = -digtrans[i];
      showDigit(dig[i], digPos[i], dig6x8);
      digtrans[i]--;
    }
  }
  dy=0;
  setCol(15,dots ? B00100100 : 0);
  setCol(16,dots ? B00100100 : 0);
  setCol(34,dots ? B00100100 : 0);
  setCol(35,dots ? B00100100 : 0);
  refreshAll();
  delay(30);
}

// =======================================================================

void showDigit(char ch, int col, const uint8_t *data)
{
  if(dy<-8 | dy>8) return;
  int len = pgm_read_byte(data);
  int w = pgm_read_byte(data + 1 + ch * len);
  col += dx;
  for (int i = 0; i < w; i++)
    if(col+i>=0 && col+i<8*NUM_MAX) {
      byte v = pgm_read_byte(data + 1 + ch * len + 1 + i);
      if(!dy) scr[col + i] = v; else scr[col + i] |= dy>0 ? v>>dy : v<<-dy;
    }
}

// =======================================================================

void setCol(int col, byte v)
{
  if(dy<-8 | dy>8) return;
  col += dx;
  if(col>=0 && col<8*NUM_MAX)
    if(!dy) scr[col] = v; else scr[col] |= dy>0 ? v>>dy : v<<-dy;
}

// =======================================================================

int showChar(char ch, const uint8_t *data)
{
  int len = pgm_read_byte(data);
  int i,w = pgm_read_byte(data + 1 + ch * len);
  for (i = 0; i < w; i++)
    scr[NUM_MAX*8 + i] = pgm_read_byte(data + 1 + ch * len + 1 + i);
  scr[NUM_MAX*8 + i] = 0;
  return w;
}

// =======================================================================

void printCharWithShift(unsigned char c, int shiftDelay) {
  
  if (c < ' ' || c > '~'+25) return;
  c -= 32;
  int w = showChar(c, font);
  for (int i=0; i<w+1; i++) {
    delay(shiftDelay);
    scrollLeft();
    refreshAll();
  }
}

// =======================================================================

void printStringWithShift(const char* s, int shiftDelay){
  while (*s) {
    printCharWithShift(*s, shiftDelay);
    s++;
  }
}

// =======================================================================

float utcOffset = 1;//GMT+1
long localEpoc = 0;
long localMillisAtUpdate = 0;

void getTime()
{
  WiFiClient client;
  if (!client.connect("www.google.com", 80)) {
    Serial.println("connection to google failed");
    return;
  }

  client.print(String("GET / HTTP/1.1\r\n") +
               String("Host: www.google.com\r\n") +
               String("Connection: close\r\n\r\n"));
  int repeatCounter = 0;
  while (!client.available() && repeatCounter < 10) 
  {
    delay(500);
    //Serial.println(".");
    repeatCounter++;
    
  }

  String line;
  client.setNoDelay(false);
  while(client.connected() && client.available()) {
    line = client.readStringUntil('\n');
    line.toUpperCase();
    if (line.startsWith("DATE: ")) {
      date = "     "+line.substring(0, 22);
      h = line.substring(23, 25).toInt();
      m = line.substring(26, 28).toInt();
      s = line.substring(29, 31).toInt();
      localMillisAtUpdate = millis();
      localEpoc = (h * 60 * 60 + m * 60 + s);
      
    }
  }
  client.stop();
}

// =======================================================================

void updateTime()
{
  long curEpoch = localEpoc + ((millis() - localMillisAtUpdate) / 1000);
  long epoch = round(curEpoch + 3600 * utcOffset + 86400L);
  h = ((epoch  % 86400L) / 3600) % 24;
  m = (epoch % 3600) / 60;
  s = epoch % 60;
}

// =======================================================================

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