I got it to work.
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); }); });
@cwilt started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I got it to work.