mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/sntp_timezone' into 'master'
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 See merge request !722
This commit is contained in:
commit
8e3c30a27d
@ -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