<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Daniel,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
One thing to keep in mind - the TZ database is prolific, and already has widespread adoption in many platforms, languages and libraries.  Sure, there are many cases where one might need to go back to the sources, but most of the time there's already work of
 others to leverage.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
In the case of the NodeMCU platform, I suggest you start with the "TZ" LUA module, shown here:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<a href="https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_examples/timezone" id="LPNoLP540099">https://github.com/nodemcu/nodemcu-firmware/tree/master/lua_examples/timezone</a><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
You'll want to use current data files though, rather than the few that are given there.  You should be able to generate them with the zic compiler from this project (though getting it working on Windows is tricky) - or you can just gather them precompiled from
 any tzdata distribution on a Linux system.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Cheers</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
-Matt</div>
<br>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> tz-bounces@iana.org <tz-bounces@iana.org> on behalf of Daniel Ford <dfnojunk@gmail.com><br>
<b>Sent:</b> Saturday, October 14, 2017 5:45 AM<br>
<b>To:</b> tz@iana.org<br>
<b>Subject:</b> [tz] Beginner's help request</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">I'm looking to develop a 'world clock' that could be sold to anyone (with<br>
Internet access via a Wi-Fi AP) anywhere in the world, that will display<br>
their local time, taking into account DST if/when applicable.<br>
<br>
Given that DST 'rules' can change at the whim of governments, my firmware<br>
will need to annually look up 'current' DST rules from the web.  After much<br>
searching, it seems that your TZ Database is the best supported such<br>
reference for time zone rules.  But I'm having great difficulty working out<br>
how I might access its mine of information...<br>
<br>
(I'll understand if you don't have time to help out a beginner, and maybe<br>
then you could refer me to a help site for TZ database applications.)<br>
<br>
I'm a hardware engineer with some programming experience, particularly<br>
assembler (various MCUs) and some C, but little or no experience in other<br>
languages.  I'm developing this clock on an Arduino-like platform (NodeMCU,<br>
which has in-built Wi-Fi).  My development tools run on a Win7Pro64 PC.<br>
<br>
The tools that you kindly provide for your database appear to be geared<br>
primarily towards Linux/Unix platforms, and I have no idea how I might<br>
convert them for a NodeMCU!  I'm looking for some 'simple' way to access the<br>
desired TZ/DST information, preferably using simple string searches.<br>
<br>
For my application, all I'm interested in are the *current* rules.  The<br>
wealth of history in your db is undoubtedly of interest to many, but for me<br>
is just 'clutter' to be searched through.  But writing a program to find<br>
those rules for a particular locality has me stumped right now.  I can't<br>
expect my dumb users to know a letter code for their time-zone/DST-rules, so<br>
all I'm expecting them to select from program-generated lists are: (1) their<br>
world region (Europe, Asia, Australasia, etc), and (2) the name of a major<br>
city in their time-zone with the same DST rules they follow.<br>
<br>
Let's take a concrete example: say my user has nominated 'Australasia' and<br>
'Hobart'.  So I look in your Australasia file and do a (manual at this<br>
stage) search for 'Hobart', but find only one reference to it (other than in<br>
comments).  The jumble of numbers and letters there do not (clearly) tell me<br>
when DTS starts or ends.  So how could I possibly write some code to find<br>
out that required information??<br>
<br>
I've looked through the TZ_database-2017b.tar file for some sort of 'how-to'<br>
explanation of what all the file contents mean and how to programmatically<br>
search for a specific TZ, but have so far found nothing.<br>
<br>
Ideally, what I'd like to see is a text-only table of just current TZ/DST<br>
rules for each region/locality (they could all fit into a single file with<br>
all the historical data and comments removed), perhaps in the clear form<br>
used by Jack Christensen in his excellent Arduino Timezone library examples,<br>
such as...<br>
<br>
// Australia Eastern Time Zone (Sydney, Melbourne, Hobart)<br>
TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660};<br>
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};<br>
TimezoneExt ausET("NSW, Vic, Tas", aEDT, aEST);<br>
// Australia Eastern Time Zone (Brisbane)<br>
TimezoneExt QldT("Queensland", aEST, aEST);  // no DST in Qld!<br>
<br>
... which clearly tells me in a program-searchable way that in the main<br>
eastern states DST starts on the first Sunday in October at 2am, becoming<br>
UTC offset +11 hours (660 minutes), and ends on the first Sunday in April at<br>
3am, reverting to UTC offset +10 hours.  Couldn't be simpler!<br>
<br>
Any help in using the TZ database will be much appreciated (and acknowledged<br>
in my source code).<br>
<br>
Regards,<br>
Daniel<br>
---------------<br>
Daniel Ford (Gerroa, Australia)<br>
"My loathings are simple: stupidity, oppression, crime, cruelty, soft<br>
music." - Vladimir Nabokov<br>
<br>
</div>
</span></font>
</body>
</html>