Sanjeev, Thanks for your comments, which I'll address before the other feedback I've received, since the others will require more considered responses... Firmware planning has barely started, but my current intention is to have the NodeMCU start-up (first-time only) in Wi-Fi AP mode, with a specified SSID/password. So the user will be expected to log onto that AP to work through the set-up pages. Apart from the user's own SSID/Password (for their own 'home' AP), no free-form text will be allowed. They must select first their 'region', from a displayed list, and then their 'reference city' from another displayed list (which, of course, will only contain cities from the *nominated* region). So naturally I'll choose those region and city names to be compatible with those used in the TZdb. Regards, Daniel ________________________________ From: Sanjeev Gupta [mailto:ghane0@gmail.com] Sent: Sunday, October 15, 2017 3:24 PM To: Daniel Ford Cc: tz@iana.org Subject: Re: [tz] Beginner's help request
Let's take a concrete example: say my user has nominated 'Australasia' and 'Hobart'. So I look in your Australasia file and do a (manual at this stage) search for 'Hobart', but find only one reference to it (other than in comments).
If you allow the user to enter the City Name, please note that the user might enter "Hovarta", which is the (made-up) localised version of the name of the city. cf Kolkotta, Wien, etc This issue turns up regularly on the list (along with "But that is not the biggest city, including suburbs). The TZ database does not deal with UI issues, in this respect, you will have to handle them. Will your clock have a UI? Accessible as a web page, or with up/down/select buttons? -- Sanjeev Gupta +65 98551208 http://www.linkedin.com/in/ghane On Sat, Oct 14, 2017 at 8:45 PM, Daniel Ford <dfnojunk@gmail.com> wrote: I'm looking to develop a 'world clock' that could be sold to anyone (with Internet access via a Wi-Fi AP) anywhere in the world, that will display their local time, taking into account DST if/when applicable. Given that DST 'rules' can change at the whim of governments, my firmware will need to annually look up 'current' DST rules from the web. After much searching, it seems that your TZ Database is the best supported such reference for time zone rules. But I'm having great difficulty working out how I might access its mine of information... (I'll understand if you don't have time to help out a beginner, and maybe then you could refer me to a help site for TZ database applications.) I'm a hardware engineer with some programming experience, particularly assembler (various MCUs) and some C, but little or no experience in other languages. I'm developing this clock on an Arduino-like platform (NodeMCU, which has in-built Wi-Fi). My development tools run on a Win7Pro64 PC. The tools that you kindly provide for your database appear to be geared primarily towards Linux/Unix platforms, and I have no idea how I might convert them for a NodeMCU! I'm looking for some 'simple' way to access the desired TZ/DST information, preferably using simple string searches. For my application, all I'm interested in are the *current* rules. The wealth of history in your db is undoubtedly of interest to many, but for me is just 'clutter' to be searched through. But writing a program to find those rules for a particular locality has me stumped right now. I can't expect my dumb users to know a letter code for their time-zone/DST-rules, so all I'm expecting them to select from program-generated lists are: (1) their world region (Europe, Asia, Australasia, etc), and (2) the name of a major city in their time-zone with the same DST rules they follow. Let's take a concrete example: say my user has nominated 'Australasia' and 'Hobart'. So I look in your Australasia file and do a (manual at this stage) search for 'Hobart', but find only one reference to it (other than in comments). The jumble of numbers and letters there do not (clearly) tell me when DTS starts or ends. So how could I possibly write some code to find out that required information?? I've looked through the TZ_database-2017b.tar file for some sort of 'how-to' explanation of what all the file contents mean and how to programmatically search for a specific TZ, but have so far found nothing. Ideally, what I'd like to see is a text-only table of just current TZ/DST rules for each region/locality (they could all fit into a single file with all the historical data and comments removed), perhaps in the clear form used by Jack Christensen in his excellent Arduino Timezone library examples, such as... // Australia Eastern Time Zone (Sydney, Melbourne, Hobart) TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660}; TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600}; TimezoneExt ausET("NSW, Vic, Tas", aEDT, aEST); // Australia Eastern Time Zone (Brisbane) TimezoneExt QldT("Queensland", aEST, aEST); // no DST in Qld! ... which clearly tells me in a program-searchable way that in the main eastern states DST starts on the first Sunday in October at 2am, becoming UTC offset +11 hours (660 minutes), and ends on the first Sunday in April at 3am, reverting to UTC offset +10 hours. Couldn't be simpler! Any help in using the TZ database will be much appreciated (and acknowledged in my source code). Regards, Daniel --------------- Daniel Ford (Gerroa, Australia) "My loathings are simple: stupidity, oppression, crime, cruelty, soft music." - Vladimir Nabokov