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:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=t+yz/6wpH2CuUSwg Zrc6Pmbkotx6Lmz6OgGAawqpgEbgVJcXfMpTjHRZfISt/xG8ib2EDxaiWc4H3ttd QCmuzPgp7zUedDazKqm7/4JEu1E4FF+dsoQ+/+7tAvbwLXcnM2RecN0NIkPPoCS+ Gzs66cANY6NRBlvLKz0CCYzgmOE= 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:reply-to:subject:to:references:from:message-id :date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=wDSsTSkDMBxJ7CJWqCJ1kA crRnc=; b=QVYBx89fW0lX2bqAY5pO14vE5ezauJTsc/kIairuXY+l6xN4LxcIaZ Y0C1ajQL/31CIPo+RPd15OCYtBDSmLsQV7kGPp71iDVcLheTDl32pZodg9jP9E77 pLUUfttRLoSzYvZHmvrw6P94vPMdTKfz3IyIyFeMDKlCl4eqYmcv0= 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=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=demanding, scratching, our X-HELO: smtp-out-no.shaw.ca X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=Km5KNKZfAgWv-1nbDTgA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca Subject: Re: Cygwin strptime() is missing "%s" which strftime() has To: cygwin AT cygwin DOT com References: <BY1PR09MB0343072DC1C2667AAD1EEFF0A5BB0 AT BY1PR09MB0343 DOT namprd09 DOT prod DOT outlook DOT com> <f73a8d58-edc5-b9ee-86c8-e44dbd3d3944 AT redhat DOT com> From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca> Message-ID: <b47ea944-1342-7ddf-8234-8810b74c40e8@SystematicSw.ab.ca> Date: Mon, 24 Jul 2017 16:48:58 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <f73a8d58-edc5-b9ee-86c8-e44dbd3d3944@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfOvOZ6JdapxXn1evaO1p97UmcLMRUZT6igQLsMgLosjlxmpq88O3Eebfuc6YByGWpc20URBOK1pdRXpEoQTnpRXHcJDwp+DvE5GdkOF6pz4xV7ZAs/mT nZKJRyYkdGmpzJi+D55SVxRAr32baZcZI+ip/k1w65paygae1zkBkiF5ctdhuiOaqvY3dTTvQayG1w== X-IsSubscribed: yes On 2017-07-24 15:48, Eric Blake wrote: > On 07/24/2017 04:28 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: >>> then its use of %s in either of those functions constitutes a _bug_ >> >> Oh really? Is that why "%s" was added to Cygwin's strftime() lately? > > Your mailer is breaking up threads, which is making it very annoying to > follow where your replies are landing. > > strftime() has been formatting %s since Oct 2015 (if you can call that > "lately"). In fact, you made me check git history: it was not me that > added it (like I thought, so I must have added it in gnulib instead); > but Brian - in fact, the same Brian who is now working on adding %s to > strptime(). > > The point remains: if you want your program to be portable, you should > not use %s. But if your program is okay with demanding a GNU/Linux > environment rather than sticking to portable code, then Cygwin still > tries to cater to that by providing as many GNU/Linux extensions as > possible, and pointing out where we fall short is appreciated. But > still, someone has to code it, this is a volunteer effort, and we tend > to scratch our own itches. The fact that strptime() lagged strftime() > by nearly 2 years in adding %s support is par for the course. It's not > worth complaining about, and if you want faster action, then submit > patches yourself instead of asking others to do it for you. My itch is that it doesn't work in dateutils strptime(1), so the hope is that if %s (also %F) works in newlib libc strptime(3), that will get it working in dateutils strptime(1), as it does in coreutils date(1), or I'll have to do some more scratching. Of course, C code could just convert the seconds strings to some BIG_INT, put it in a time_t, and use localtime(3) or gmtime(3) to get a struct tm for use in strftime(3). Shell scripts could use coreutils date(1) instead of dateutils strptime(1) to convert time_t using %s (and more). It would be great if all the time utilities and functions could support a consistent set (GNU) of time conversion specifications. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple