ArduinoIDE 1.6.7 users should read my post here.
This project uses exactly the same hardware as my previous project for the ESP8266 and Warwalking. Only the software has been changed. Now, when powered-up, the ESP8266 will log into your home router, connect to NIST, and request the current time and date. If all of the timing goes correct, the request will be returned, assembled into a string, parsed, and the date and time displayed on the OLED.
NIST queries must occur no more frequent that 60 seconds, so the ESP8266 waits, counts down the seconds by 10 and then in the last 10 seconds by 1. Then a connection is made to NIST and the above process is repeated.
Based upon information found from NIST on this page, users may wish to modify the code line:
const char* host = "220.127.116.11";
const char* host = "time.nist.gov"; // Round-robin DAYTIME protocol
This will permit continued use of your NIST Internet clock should the server go down at the University of Colorado, Bolder. The time.nist.gov link automatically is directed to the least loaded server in the NIST server farm.