esp8266 and Get NTP time

Hello.
I want get time from NTP server with my ESP8266 connectet to Arduino Mega in serial mode.
With this scketch I receive always time starting from 01.00.00.

How I can modify it for good result? Have anyone a specified scketch for this?

Thanks you.

Get_Web_Time_v003.ino (1.59 KB)

It is not cool to poll an NTP server once a second. If you ping too often it will send you a kiss-of-death message and refuse to communicate with your IP.

This sketch looks like an example from the library that you included. There are likely to be more in the example sketch folder.

Search for Andrea Speiss library, "the guy with the swiss accent" , there is also a YouTube tutorial which he explains in detail. His library works very well