OK, I give up. I've tried looking at the source code and it's hopeless. Can someone please explain to me how to read the binary files and turn it into timezone information? All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.) The code is not commented and I can find no documents. Please, I beg you, help me.
Thom Hehl wrote:
The code is not commented and I can find no documents.
The document you want is the man page tzfile(5). You can find it in the tzcode tarball, in files tzfile.5 (roff source) and tzfile.5.txt (rendered plain text). I personally found this document extremely clear and adequately complete when I wrote my own tzfile reader. -zefram
On Wed, 2 Nov 2011, Thom Hehl wrote:
OK, I give up. I've tried looking at the source code and it's hopeless.
Can someone please explain to me how to read the binary files and turn it into timezone information?
All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.)
I've code for that at: http://svn.xdebug.org/cgi-bin/viewvc.cgi/timelib/trunk/?root=php svn co svn://svn.xdebug.org/svn/php/timelib/trunk timelib regards, Derick
if you don't know what you're doing, you're probably better served by icu4c. they have APIs similar to the Java ones, but for C and C++. (i assume you don't want Java because if you did, you could just use the built-in stuff.) On Wed, Nov 2, 2011 at 05:17, Thom Hehl <Thom@pointsix.com> wrote:
OK, I give up. I’ve tried looking at the source code and it’s hopeless.*** *
** **
Can someone please explain to me how to read the binary files and turn it into timezone information?****
** **
All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.)****
** **
The code is not commented and I can find no documents.****
** **
Please, I beg you, help me.****
** **
-- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ NIO or JNI questions? Mail me/drop by/add me as a reviewer.
That doesn’t have the timezone database built in, does it? From: enh [mailto:enh@google.com] Sent: Wednesday, November 02, 2011 12:37 PM To: Thom Hehl Cc: tz@iana.org Subject: Re: [tz] Reading binary files if you don't know what you're doing, you're probably better served by icu4c. they have APIs similar to the Java ones, but for C and C++. (i assume you don't want Java because if you did, you could just use the built-in stuff.) On Wed, Nov 2, 2011 at 05:17, Thom Hehl <Thom@pointsix.com> wrote: OK, I give up. I’ve tried looking at the source code and it’s hopeless. Can someone please explain to me how to read the binary files and turn it into timezone information? All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.) The code is not commented and I can find no documents. Please, I beg you, help me. -- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ NIO or JNI questions? Mail me/drop by/add me as a reviewer.
last time i looked, yes, it carries about its own copy. (which is either an advantage or disadvantage, depending on how you look at it.) see, for example: http://source.icu-project.org/repos/icu/data/trunk/tzdata/icunew/ On Wed, Nov 2, 2011 at 09:37, Thom Hehl <Thom@pointsix.com> wrote:
That doesn’t have the timezone database built in, does it?****
** **
*From:* enh [mailto:enh@google.com] *Sent:* Wednesday, November 02, 2011 12:37 PM *To:* Thom Hehl *Cc:* tz@iana.org
*Subject:* Re: [tz] Reading binary files****
** **
if you don't know what you're doing, you're probably better served by icu4c. they have APIs similar to the Java ones, but for C and C++.****
** **
(i assume you don't want Java because if you did, you could just use the built-in stuff.)****
** **
On Wed, Nov 2, 2011 at 05:17, Thom Hehl <Thom@pointsix.com> wrote:****
OK, I give up. I’ve tried looking at the source code and it’s hopeless.*** *
****
Can someone please explain to me how to read the binary files and turn it into timezone information?****
****
All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.)****
****
The code is not commented and I can find no documents.****
****
Please, I beg you, help me.****
****
****
** **
-- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ NIO or JNI questions? Mail me/drop by/add me as a reviewer.****
-- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ NIO or JNI questions? Mail me/drop by/add me as a reviewer.
Take a look at the "zdump" utility. paul From: tz-bounces@iana.org [mailto:tz-bounces@iana.org] On Behalf Of Thom Hehl Sent: Wednesday, November 02, 2011 8:18 AM To: tz@iana.org Subject: [tz] Reading binary files OK, I give up. I've tried looking at the source code and it's hopeless. Can someone please explain to me how to read the binary files and turn it into timezone information? All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.) The code is not commented and I can find no documents. Please, I beg you, help me.
Paul_Koning@Dell.com wrote:
Take a look at the "zdump" utility.
That's not very revealing, since it defers to libc for reading of tzfiles. Which is damned annoying, because it's liable to give only 32-bit behaviour when your tzfiles are 64-bit. (On the other hand, it'll equally well dump a zone defined by a POSIX $TZ value or in any other non-Olson way that the host supports.) -zefram
Hi ! I think you could use LibICU for this. Cheers, Ilya 11/02/2011 02:17 PM, ext Thom Hehl пишет:
OK, I give up. I've tried looking at the source code and it's hopeless.
Can someone please explain to me how to read the binary files and turn it into timezone information?
All I need to do is write a function that will take a UTC date and convert it into a timezone with a name that I specify and convert it back again. (I understand there are precision issues with the last one.)
The code is not commented and I can find no documents.
Please, I beg you, help me.
On 02.11.2011 13:17 CE(S)T, Thom Hehl wrote:
OK, I give up. I’ve tried looking at the source code and it’s hopeless.
Can someone please explain to me how to read the binary files and turn it into timezone information?
I have written a C# programme that reads the binary tz files and converts them into C# code that I can then use in my application. From then on, all tz data is stored as code in my application (no external files) and I can use it for any calculation. Would that help you? -- Yves Goergen "LonelyPixel" <nospam.list@unclassified.de> Visit my web laboratory at http://beta.unclassified.de
participants (7)
-
Derick Rethans -
enh -
Ilya Dogolazky -
Paul_Koning@Dell.com -
Thom Hehl -
Yves Goergen -
Zefram