Getting NTP Time from server

Hi

How can i get the time from an ntp server for united kingdom

with corona

how can i display this time on screen with a simple print statement

thankyou

You need to find an NTP service that offers a REST API. This page lists several:

https://stackoverflow.com/questions/13240530/free-rest-api-to-retrieve-current-datetime-as-string-timezone-irrelevant

Then you can use Corona’s network.request() API to call the necessary URL from the NTP server, it will likely return you a JSON object in the event.response value in the network.request() handler function…  Then you can then use our json.decode()  API to turn the JSON object into a Lua table and then access the time.

Rob

You need to find an NTP service that offers a REST API. This page lists several:

https://stackoverflow.com/questions/13240530/free-rest-api-to-retrieve-current-datetime-as-string-timezone-irrelevant

Then you can use Corona’s network.request() API to call the necessary URL from the NTP server, it will likely return you a JSON object in the event.response value in the network.request() handler function…  Then you can then use our json.decode()  API to turn the JSON object into a Lua table and then access the time.

Rob