How do I handle timezone for my devices?
ESP RainMaker provides automatic timezone management:
-
Enable time service:
esp_rmaker_time_service_enable(); -
Get current time:
time_t now;
time(&now);
struct tm timeinfo;
localtime_r(&now, &timeinfo);
The timezone is automatically set based on the user's account settings in the phone app.
For more details, see Time Service Usage.