Need Help for NTP Configurations for ESP32

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Need Help for NTP Configurations for ESP32

Postby Ritesh » Mon May 29, 2017 8:08 am

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.
Regards,
Ritesh Prajapati

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Need Help for NTP Configurations for ESP32

Postby kolban » Mon May 29, 2017 10:29 pm

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
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Need Help for NTP Configurations for ESP32

Postby Ritesh » Tue May 30, 2017 4:29 am

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.
Regards,
Ritesh Prajapati

jaracil
Posts: 11
Joined: Sat Apr 02, 2016 4:24 pm

Re: Need Help for NTP Configurations for ESP32

Postby jaracil » Wed Jul 19, 2017 12:04 pm

We just created a GitHub project to maintain posix time zone strings DB.

https://github.com/nayarsystems/posix_tz_db

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

Re: Need Help for NTP Configurations for ESP32

Postby martinayotte » Wed Jul 19, 2017 2:53 pm

The DB is missing "America/Montreal" ... :ugeek:

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Need Help for NTP Configurations for ESP32

Postby ESP_igrr » Wed Jul 19, 2017 4:03 pm

jaracil: this is super useful, thank you for sharing. Would you mind to amend Readme mentioning what license is the project distributed under?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Need Help for NTP Configurations for ESP32

Postby WiFive » Wed Jul 19, 2017 8:49 pm

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.

jaracil
Posts: 11
Joined: Sat Apr 02, 2016 4:24 pm

Re: Need Help for NTP Configurations for ESP32

Postby jaracil » Thu Jul 20, 2017 9:35 am

martinayotte: Added America/Montreal.

ESP_Igrr: Just Added LICENSE file (MIT).

User avatar
martinayotte
Posts: 141
Joined: Fri Nov 13, 2015 4:27 pm

Re: Need Help for NTP Configurations for ESP32

Postby martinayotte » Thu Jul 20, 2017 3:38 pm

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/

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Need Help for NTP Configurations for ESP32

Postby WiFive » Thu Jul 20, 2017 10:44 pm

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.

Who is online

Users browsing this forum: Google [Bot] and 118 guests