Page 1 of 1

Need Help for NTP Configurations for ESP32

Posted: Mon May 29, 2017 8:08 am
by Ritesh
Hi,

I have used NTP configurations to set time and it works fine without any issue. But, I need total List of Timezone configurations used for all over world to set time for any specific area.

Right Now, I have used following configurations as per my requirement.

// Set timezone to UTC Time
setenv("TZ", "UTC", 1);

// Set timezone to Indian Standard Time
setenv("TZ", "UTC+05:30", 1);

// Set timezone to Eastern Standard Time
setenv("TZ", "EST5EDT,M3.2.0/2,M11.1.0", 1);

// Set timezone to China Standard Time
setenv("TZ", "CST-8CDT-9,M4.2.0/2,M9.2.0/3", 1);

So, Please provide me List of standard timezone to be used world wide to set corresponding time according to setenv API. Also, Let me know if anyone has included all those timezones into single array because our application can be used in any place across world and we want to configured timezone according to that from application.

Let me know if anyone has any confusion for above use-case.

Re: Need Help for NTP Configurations for ESP32

Posted: Mon May 29, 2017 10:29 pm
by kolban
This is likely what you are looking for:

https://www.iana.org/time-zones

This was referenced here:

https://www.gnu.org/software/libc/manua ... iable.html

Re: Need Help for NTP Configurations for ESP32

Posted: Tue May 30, 2017 4:29 am
by Ritesh
kolban wrote:This is likely what you are looking for:

https://www.iana.org/time-zones

This was referenced here:

https://www.gnu.org/software/libc/manua ... iable.html
Thanks for providing informations.

I will check and will let you know if need any further help for that.

Re: Need Help for NTP Configurations for ESP32

Posted: Wed Jul 19, 2017 12:04 pm
by jaracil
We just created a GitHub project to maintain posix time zone strings DB.

https://github.com/nayarsystems/posix_tz_db

Re: Need Help for NTP Configurations for ESP32

Posted: Wed Jul 19, 2017 2:53 pm
by martinayotte
The DB is missing "America/Montreal" ... :ugeek:

Re: Need Help for NTP Configurations for ESP32

Posted: Wed Jul 19, 2017 4:03 pm
by ESP_igrr
jaracil: this is super useful, thank you for sharing. Would you mind to amend Readme mentioning what license is the project distributed under?

Re: Need Help for NTP Configurations for ESP32

Posted: Wed Jul 19, 2017 8:49 pm
by WiFive
martinayotte wrote:The DB is missing "America/Montreal" ... :ugeek:
Same TZ as Toronto, right? To have the most compact db you only want to list the largest city per time zone. Although there are 8 cities listed in Indiana for some reason.

Re: Need Help for NTP Configurations for ESP32

Posted: Thu Jul 20, 2017 9:35 am
by jaracil
martinayotte: Added America/Montreal.

ESP_Igrr: Just Added LICENSE file (MIT).

Re: Need Help for NTP Configurations for ESP32

Posted: Thu Jul 20, 2017 3:38 pm
by martinayotte
Thanks, jaracil !
WiFive wrote:Same TZ as Toronto, right?
Right ! But the same is true for Ottawa/Detroit/Boston/Washington/New York/Philadelphia/Atlanta/Indianapolis/Miami ... :ugeek:
https://www.timeanddate.com/time/map/

Re: Need Help for NTP Configurations for ESP32

Posted: Thu Jul 20, 2017 10:44 pm
by WiFive
Right but these are not on the list either Ottawa/Boston/Washington/Philadelphia/Atlanta/Miami

To make it as compact as possible, it should be only one listing per time zone per country/region and use the largest city.