Another developer writing code to use the tz database

Goudge, Stephen stephen.goudge at joyce-loebl.com
Mon Jan 28 17:14:59 UTC 2008


Hello,

I'd like to express my gratitude and admiration to all the
contributors to the time zone database.

I am working to make use of the tzdata* information to attach
timezone data plus a UTC timestamp to video recordings made by a DVR
and to then, during playback, display the correct local time to match
the video irrespective of the timezone settings on the playback
computer.

To fit the needs of the DVR, instead of storing an id string we have
to store (at most) a 16-bit integer, so there is a C enum plus lookup
table to map from these integer 'tz codes' to string ids that can be
matched against the names in the tzdata files. So obviously there is
an immediate maintenance need to keep the enum and mapping in step
with tzdata - and this has an interesting correspondence to the
declared needs of the CLDR project in terms of the stability of the
tz id strings...

For various reasons, including the need for playback to operate under
Windows and to fit the new functionality into an existing code base,
I opted to modify 'zic' and all the time functions (localtime etc).
The time functions are changed to remove the limitations of the Posix
approach (setting a global TZ, formatting one time value, resetting
the global TZ...) and to convert the representation from time_t to
the one we use internally (effectively Windows FILETIME as a 64-bit
value); the results have then been attached to the C++ 'time' classes
we use. 'zic' was then modified to change the epoch etc to match
FILETIME and then, as I really didn't want to dump a load of settings
into the Registry nor create a raft of files to tempt our Users to
fiddle, write out a single Zip archive with the compiled tz data.

Both of these items - the C library containing the enum and the C++
library with modified 'zic' etc - are Open Source, although I haven't
"published" them on any websites or repositories (well, not recently
enough to contain these TZ related tweaks). I would welcome any
interest in seeing this code, if only to give the impetus to tidy it
up well enough to "publish" (although, a warning, this is "Yet
Another Pile of Someone's Favourite Stuff" and the TZ materials are
currently fairly well integrated into the middle of it all).


Regards,
Stephen Goudge

Transport R&D
Petards Joyce-Loebl
Gateshead, UK

Private, Confidential and Privileged. This e-mail and any files and
attachments transmitted with it are confidential and/or privileged.
They are intended solely for the use of the intended recipient(s).  The
content of this e-mail and any file or attachment transmitted with it
may have been changed or altered without the consent of the author.  If
you are not the intended recipient, please note that any review,
dissemination, disclosure, alteration, printing, circulation or
transmission of this e-mail and/or any file or attachment transmitted
with it, is prohibited and may be unlawful.  If you have received this
e-mail or any file or attachment transmitted with it in error please
notify the IT Manager, Petards Joyce-Loebl Limited, 390 Princesway,
Gateshead, NE11 0TU, telephone no: +44 191 4203000.

Petards Joyce-Loebl Limited is registered in England under number
2170100




DISCLAIMER: Privileged / Confidential Information may be contained in this message.
If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone.  In such case, you should destroy this message and kindly notify the sender by reply email.
Please advise immediately if you or your employer do not consent to Internet email messages of this kind.
Opinions, conclusions and other information in this message that do not relate to the official business of my company shall be understood as neither given nor endorsed by it.



_____________________________________________________________________________________
This email has been scanned by Petards Joyce-Loebl.  The service is powered by MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email.
_____________________________________________________________________________________




More information about the tz mailing list