delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; q=dns; s= | |
default; b=InLommJpux15KTrWt+55kkOLpIyWR6+cj9xaoXQztMOcVX6ttbcL9 | |
ebkViALyChDDP1l29gFGWII8uB1NYw7/XVjBnXWLVqhgqcKBcIsfi9NDR+vPH1zH | |
gAJAqff6JSuH8t+KJm9IN6mGFdSMMg0suYZSX/GI+0spn3Qk40SEkY= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:date:from:to:subject:message-id:reply-to | |
:references:mime-version:content-type:in-reply-to; s=default; | |
bh=6m0npNZks163H91sZx8WKp8IDpw=; b=u+INHHufD6DjCAZTOrv8o+uf+2sG | |
rewkGmqPYYeJ7mqqzPBUDhyGm9c31QEYaptm5/ZdLYusauTyYJXReimR5Qx8HEIA | |
2ef6NXQH/EQK3nLvmsxzuOclryQRengl52Bnufepu2xLMGQsR/NezA2jQ0y8M1qM | |
XuTZUVuQwJr/P7E= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-4.6 required=5.0 tests=AWL,BAYES_50 autolearn=ham version=3.3.2 |
X-HELO: | calimero.vinschen.de |
Date: | Tue, 13 Jan 2015 10:10:13 +0100 |
From: | Corinna Vinschen <corinna-cygwin AT cygwin DOT com> |
To: | cygwin AT cygwin DOT com |
Subject: | Re: Bug in strftime %z |
Message-ID: | <20150113091013.GS15791@calimero.vinschen.de> |
Reply-To: | cygwin AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
References: | <003701d01ba3$a444b5d0$ecce2170$@belarc.com> <54947202 DOT 3010007 AT t-online DOT de> <20150107215004 DOT GC4190 AT calimero DOT vinschen DOT de> <20150108152638 DOT GQ4190 AT calimero DOT vinschen DOT de> <54B40549 DOT 1040804 AT t-online DOT de> |
MIME-Version: | 1.0 |
In-Reply-To: | <54B40549.1040804@t-online.de> |
User-Agent: | Mutt/1.5.23 (2014-03-12) |
--5VuzLDXibKSJvVYD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Jan 12 18:32, Christian Franke wrote: > Corinna Vinschen wrote: > >On Jan 7 22:50, Corinna Vinschen wrote: > >>Hi Christian, > >> > >> > >>thanks for the testcase! > >> > >>On Dec 19 19:44, Christian Franke wrote: > >>>$ cat strftest.c > >>>#include <time.h> > >>>#include <stdio.h> > >>>#include <stdlib.h> > >>> > >>>int main(int argc, char **argv) > >>>{ > >>> time_t t =3D (argc > 1 ? atol(argv[1]) : time(NULL)); > >>> struct tm *tm =3D localtime(&t); > >>> char buf[100]; > >>> strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %z (%Z)", tm); > >>> printf("%s\n", buf); > >>> return 0; > >>>} > >>> > >>>$ gcc -o strftest strftest.c > >>> > >>>$ echo $TZ > >>>Europe/Berlin > >>> > >>>$ ./strftest 1419010000 > >>>2014-12-19 18:26:40 +0200 (CET) > >>> > >>>$ ./strftest 1436200000 > >>>2015-07-06 18:26:40 +0053 (CEST) > >>Surprisingly this is an old problem which exists in this form since 201= 1. > >>Weird that nobody noticed it so far. Or I missed earlier bug reports :} > >>The underlying cause was that the info for std and dst offsets was taken > >>from the wrong spot in the file. The weird 0053 offset is a result of > >>wrongly using the LMT offset for Europe/Berlin. > >> > >>While this fixes the problem for recent timestamps, it will probably > >>fail for older timestamps when other dst rules were active. > >> > >>The latest Cygwin versions come with an extended struct tm which adds > >>members tm_offset and tm_zone for newly built applications. I'm working > >>on a patch so strftime utilizes these members if they are available. > >>I hope to get this finished tomorrow. > >I uploaded a snapshot containing the fixes in tzload and strftime to > >https://cygwin.com/snapshots/ Please give it a try. >=20 > %z now works as expected. Cool, thank for testing! Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --5VuzLDXibKSJvVYD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUtOD1AAoJEPU2Bp2uRE+gArEP/A3l2BFmyAsroAdQnNtFT8Be +4ijnH0LclXDZAun0kwe4qhva1Pl3LPLRa94+ugdewBtC8QYc4YdYGCzhI3OzaJD VkakcT1ja1UA65+y0nzVJZgqd18hsIOpwjZPFAtGk934r/9/GvAz0MCBk5cZUF4r LZ7DZ61FvIF8fGGlzYR5iw/MZPKOV8KBwrvC/NiPcDA6RGVcYBGOBKUK2mm+Tt+f LwxXK3lKAlwTYFgLppFsNLcTrWYneigZhEIJq7Ozopr3XCXGbH1z5/8Hn3TsCmVI TM01L4SZxq4bpllMREImEm7WYQOmdgQ2xBoKt8tF/zj2rbsp/lLujhJwkAQTBP+z krat1Tw8YdBbxnXvGl6nQTbNbIX7n2e5Fn+gi5nGEPAT2Oco+/bM4b37ra34iEU2 7X0QiPQpHt/bW3Nsyqp4j2MbD+Boq0T+xfQ8Sh1hzv5Rzg9jwh0UTSFWLt4UYovr qRep4O+IyeIqeGA2KZVImqPq8pRsIKp2DZ7RkVb06JhSkLE4iTWg2GDsIkh/yAuV xy+Pe7l8CaoPRWa1a4MTh5WHWVQs5hr+c/i6a6QIcMXbpu+6mbaQaDgEkulfH/Uj s1lYgyRzbK3cMXtTHeXHWKQhzLBMpK8a5v7BsG4bCMHmQAHo0SPQ1JpEixq3WGje wd3oag6nBO70JOUXdk7u =BpH0 -----END PGP SIGNATURE----- --5VuzLDXibKSJvVYD--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |