mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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
@ -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…
x
Reference in New Issue
Block a user