examples: fix timezone for China in SNTP example
Daylight saving time isn’t observed in China. Fixes https://github.com/espressif/esp-idf/issues/549
This commit is contained in:
parent
523a76fe0b
commit
4c01929a1e
1 changed files with 1 additions and 1 deletions
|
@ -80,7 +80,7 @@ void app_main()
|
|||
ESP_LOGI(TAG, "The current date/time in New York is: %s", strftime_buf);
|
||||
|
||||
// Set timezone to China Standard Time
|
||||
setenv("TZ", "CST-8CDT-9,M4.2.0/2,M9.2.0/3", 1);
|
||||
setenv("TZ", "CST-8", 1);
|
||||
tzset();
|
||||
localtime_r(&now, &timeinfo);
|
||||
strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
|
||||
|
|
Loading…
Reference in a new issue