You are reading a single comment by @user106712 and its replies. Click here to read the full conversation.
  • I use the following code on a desktop computer as well as on an ESP8266 (2v04).

    function getTime() {
    
            require("http").get("http://worldtimeapi­.org/api/timezone/America/Toronto", function (res) {
                    res.on('data', function (data) {
                            console.log(data);
                            console.log(JSON.parse(data).datetime);
    
                    });
                    res.on('close', function (data) {
                            console.log("Connection closed");
                    });
            });
    }
    
    getTime();
    

    node.js on the desktop could parse the output just fine :

    <Buffer 7b 22 77 65 65 6b 5f 6e 75 6d 62 65 72 22 3a 35 30 2c 22 75 74 63 5f 6f 66 66 73 65 74 22 3a 22 2d 30 35 3a 30 30 22 2c 22 75 74 63 5f 64 61 74 65 74 ... >
    2019-12-15T12:50:08.336992-05:00
    

    ESP8266 shows the following:


    1 Attachment

    • Screen Shot 2019-12-15 at 1.00.35 PM.png
About

Avatar for user106712 @user106712 started