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:
Ivan Grokhotkov 2017-05-08 15:48:03 +08:00
commit 8e3c30a27d

View file

@ -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);