Get hour with ctime (time library with ESP8266)
The easiest way is to use the standard function localtime() or gmtime() and the struct tm. 

void loop() {
  time_t now;
  struct tm * timeinfo;
  time(&amp;now);
  timeinfo = localtime(&amp;now);  
  Serial.println(timeinfo-&gt;tm_hour);
  delay(1000);
}