I need to update date and time in some devices that are connected to Azure via Azure IoT Hub.
Is there a way to get datetime from IoT Hub?
How to manage time zones?
What time zone will provide Azure IoT Hub?
Are there other alternatives?
Not aware of such API surface being present in Azure IoT Hub, however, your options include -
pool.ntp.org
). I would use a host from NIST or other better-funded-than-ntp-org entity - https://tf.nist.gov/tf-cgi/servers.cgihttp://somethingSomething.azurewebsites.net/api/now?location=NewYork
"Abuse" your IoT Hub endpoint over HTTPS which returns date/time even for a 400 Bad Request, for example:
$ curl https://poorlyfundedskynet.azure-devices.net -i
HTTP/1.1 400 Bad Request
Content-Length: 157
..snip other headers..
Date: Wed, 11 Dec 2019 16:16:51 GMT
Note: HTTPS only. Upside: you talk to the same host for everything. Downside: No guarantee timestamp is accurate, but then again so is every other service. Embrace a little risk! :)
Edit:
Linking to this relevant GitHub issue (under Azure IoT Hub client SDK for C).