• What you're missing here is that you're doing JSON.parse(data) and not JSON.parse(data.resp)

    This works great though:

    Bangle.http("https://worldtimeapi.org/api/ip").then(data => {
      let time = JSON.parse(data.resp).datetime.split("T")[1].split(".")[0];
      g.clear();
      g.drawString("Time: " + time, 120, 120);
    }).catch(err => {
      g.clear();
      g.drawString("Error: " + err, 120, 120);
    });
    

    An in the other 7 posts you made about this - it really helps to use the remote debugging for this so you can see what's going on: https://www.espruino.com/Gadgetbridge#remote-debugging

About

Avatar for Gordon @Gordon started