OK, first pass of http://code.google.com/p/barnaby is available for download of the source. This is a C++ library with two functions: 1) List all of the timezones 2) For a given timezone name, convert UTC to that timezone It will build a DLL for you if you open the project using Visual C++. The timezone data is only version 2011i, so I will need to update it soon. Please let me know any and all feedback. Blessings!
Thom Hehl wrote:
You're using zone.tab as a canonical list of timezones, which it isn't. zone.tab is only useful for selecting timezones via countries; for a list of all timezones you can serve you should just look at the tzfiles. Your usage of time_t is not appropriate. The type you want there is dictated by the tzfile format, not by libc. You're doing a linear search (in transitionTimesIndex) that should really be a binary search. Overall it looks like you're interpreting (the 32-bit part of) the tzfile correctly, but I find the code too messy to be sure. You have some instance methods that should be class methods ("static"). There is much else that is poor about your object model, but that's all off topic for this list. -zefram
On Tue, 8 Nov 2011, Zefram wrote:
You're using zone.tab as a canonical list of timezones, which it isn't. zone.tab is only useful for selecting timezones via countries; for a list of all timezones you can serve you should just look at the tzfiles.
In a way isn't that a complete list of all necessary timezone codes to cover every piece of populated land? -- Foreca Ltd Jaakko.Hyvatti@foreca.com Tammasaarenkatu 5, FI-00180 Helsinki, Finland http://www.foreca.com
Jaakko Hyv?tti wrote:
In a way isn't that a complete list of all necessary timezone codes to cover every piece of populated land?
It logically ought to provide complete coverage of geographical zones. I've just checked this, and it turns out it does. The only canonical (non-link) zones that are not listed in zone.tab are Asia/Riyadh8[789], Etc/*, Factory, and [CEHMPW][ES]T{,[5-8][CEMP]DT}. It doesn't quite provide complete coverage of geographical link zones: aside from the "backward" links, Asia/Istanbul and Europe/Nicosia are missing from zone.tab, being instead listed under their canonical names Europe/Istanbul and Asia/Nicosia. -zefram
Well, the stuff used to build the DLL is, but that's all a wrapper around the central, hopefully portable C++ classes that actually do the heavy lifting. The file handling stuff needs some work to make it truly portable, but it's a start. -----Original Message----- From: tz-bounces@iana.org [mailto:tz-bounces@iana.org] On Behalf Of Bill Seymour Sent: Tuesday, November 08, 2011 5:52 PM To: tz@iana.org Subject: Re: [tz] Barnaby Vendor lock-in anti-pattern (Microsoft Windows-specific). --Bill Seymour
On 11/08/2011 06:12 PM, Thom Hehl wrote:
OK, first pass of http://code.google.com/p/barnaby is available for download of the source. This is a C++ library with two functions:
1)List all of the timezones
2)For a given timezone name, convert UTC to that timezone
I may have overlooked the info, but under which license is this code published?
Alois Treindl wrote:
I may have overlooked the info, but under which license is this code published?
The web page says "Eclipse Public License 1.0". <http://www.gnu.org/licenses/license-list.html> classifies it as a free software license (GPL-incompatible). -zefram
participants (5)
-
Alois Treindl -
Bill Seymour -
Jaakko Hyvätti -
Thom Hehl -
Zefram