Set time
Posted: Mon Jan 25, 2016 10:29 pm
I was able to use Espruino on the esp8266 to set the time.
Code: Select all
var timeS;
require("http").get("http://www.timeapi.org/utc/7+hours+ago?\\s", function(res) {
res.on('data', function(data) {
console.log("HTTP> "+data);
timeS=Number(data);
});
res.on('close', function(data) {
console.log("Connection closed");
setTime(timeS);
});
});