Date: Thu, 21 Dec 2000 11:04:06 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Jason Green cc: djgpp AT delorie DOT com Subject: Re: strftime: Need Help with Time Offsets In-Reply-To: <1a524t0tk28cmv3vqfq26tooe0qeikhgm5@4ax.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 20 Dec 2000, Jason Green wrote: > ftilley AT azstarnet DOT cyberbromo DOT com (Felix Tilley) wrote: > > > All of the GMT offsets are wrong. Dates and times are correct, but > > the GMT offsets are wrong. > > There appears to be a bug in strftime() when using the %z format. The bug, whether it exists or not, does not necessarily have anything to do with what Felix reported: I replied to his message saying I cannot reproduce the problem. His test program wroked for me. I suspect Felix was using an old djtzn203.zip, where timezone files were corrupted. > Well, actually not so much a bug as a feature. ;-) Actually, %z is undocumented and should not be used at all in the DJGPP version of strftime. > With existing strftime the test program outputs: > > Wed, 20 Dec 2000 20:35:42 +0000 GMT > Wed, 20 Dec 2000 20:35:42 +0000 GMT > Wed, 20 Dec 2000 08:01:42 -0000 TEST1 > Thu, 21 Dec 2000 09:09:42 +45240 TEST2 > > After patching the test program outputs: > > Wed, 20 Dec 2000 20:36:21 +0000 GMT > Wed, 20 Dec 2000 20:36:21 +0000 GMT > Wed, 20 Dec 2000 08:02:21 -1234 TEST1 > Thu, 21 Dec 2000 09:10:21 +1234 TEST2 Note that your changes modified the bahavior of %z: it is supposed to print the values in seconds, while your version prints it in hours and minutes instead. So this is more than just a bugfix for the negative offsets. > Here is the patch: Thanks.