From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12402 invoked by alias); 24 Jul 2017 20:22:49 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11920 invoked by uid 89); 24 Jul 2017 20:22:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FROM_STARTS_WITH_NUMS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=23072017, Hx-languages-length:1198 X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jul 2017 20:22:46 +0000 Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP id ZjsJda6DFDJTWZjsKdB3Vz; Mon, 24 Jul 2017 14:22:45 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17 a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=G3gG6ho9WtcA:10 a=W7M8_e7X9EEaKxGp4wAA:9 a=QEXdDO2ut3YA:10 Received: from www-data by kylheku.com with local (Exim 4.72) (envelope-from <920-082-4242@kylheku.com>) id 1dZjsJ-0003ib-3K for cygwin@cygwin.com; Mon, 24 Jul 2017 13:22:43 -0700 To: cygwin@cygwin.com Subject: Re: Cygwin strptime() is missing "%s" which strftime() has X-PHP-Originating-Script: 501:rcmail.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Jul 2017 21:02:00 -0000 From: Kaz Kylheku <920-082-4242@kylheku.com> In-Reply-To: References: Message-ID: <35cc661bda95310f57e9844bebf27158@mail.kylheku.com> X-Sender: 920-082-4242@kylheku.com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfOr9K4sEOlo6qzu6yR+bCVEB0lcpoNrwoypmd9JEj7G8loRNkvm1D+zCeM3AwKjWN499hTBP7xP3+cG8dqFB+Lh+QkzbPEIpv0i4NkAKynqo1s1wkbaV Mi3yxdUoHD6Rl6yN4m/p3Cmchjm22+lcKgXQ9G/EvoViv5HXi4bfrqMU X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00329.txt.bz2 On 23.07.2017 19:09, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: >> But that's just scanning a decimal integer to time_t. >=20 > It's not a question of whether I can or can't convert a string into an > integer, rather it's a question about portability of code that uses %s > for both functions and expects it to work unchanged in the Cygwin > environment. Also, strptime() was designed to be a reversal to > strftime() (from the man-pages: the strptime() function is the > converse function to strftime(3)) so both are supposed to "understand" > the same basic set of formats. Because of Cygwin's strptime() missing > "%s", the following also does not work even from command line: >=20 > $ date +"%s" | strptime "%s" > strptime: cannot make sense of `1500861577' using the given input=20 > formats There is no %s in POSIX. It is a GNU C library extension. Thus this is only a matter of compatibility between Cygwin and GNU/Linux (and=20 portability between those systems). Linux compatibility *is* an explicit goal of the Cygwin project. If %s=20 works on Linux but not Cygwin, in that moment you're not getting quite that "Linux feeling" on Windows. -- 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