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:to:subject:mime-version:content-type :content-transfer-encoding:date:from:in-reply-to:references :message-id; q=dns; s=default; b=e38AuhFzwdsM8D4p43BnWlkEfdw1Ydl bgHhBd+dAo93LilAMPiyDL6elAVNgeybxc97Ep9iPw4LNSsqDNsKaDn6Em0RVOUT 9x2/V/iI7r4IQ4QQtc/Qm8Xvn6Vbi8v8iwbp9Q0tnFPNT26vKLjspyU4SIvTZXvp kJD+oPhv9jHU= 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:to:subject:mime-version:content-type :content-transfer-encoding:date:from:in-reply-to:references :message-id; s=default; bh=pQKDcE/3ExIjcgpZtaDodp2a+V8=; b=e51YH RuJbK7L2ZVm/DBfK2uM1q3ahKiEBnrTMkVZnOvgttXo2pBB0DOD6hyLEebVW9gCz ZAYz64VuXFxaXri6e4sRwwhbXe8famZM0Tj9gvsgNCBAGVph65QD4jSLkrnts4jm 0+EbXXf7djBWgwGrO+8LDq6vcne+ARjoiYShF0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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.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 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 To: cygwin AT cygwin DOT 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 Date: Mon, 24 Jul 2017 13:22:43 -0700 From: Kaz Kylheku <920-082-4242 AT kylheku DOT com> In-Reply-To: References: Message-ID: <35cc661bda95310f57e9844bebf27158@mail.kylheku.com> X-Sender: 920-082-4242 AT kylheku DOT com User-Agent: Roundcube Webmail/0.9.2 X-CMAE-Envelope: MS4wfOr9K4sEOlo6qzu6yR+bCVEB0lcpoNrwoypmd9JEj7G8loRNkvm1D+zCeM3AwKjWN499hTBP7xP3+cG8dqFB+Lh+QkzbPEIpv0i4NkAKynqo1s1wkbaV Mi3yxdUoHD6Rl6yN4m/p3Cmchjm22+lcKgXQ9G/EvoViv5HXi4bfrqMU X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v6OKN5sH018995 On 23.07.2017 19:09, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: >> But that's just scanning a decimal integer to time_t. > > 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: > > $ date +"%s" | strptime "%s" > strptime: cannot make sense of `1500861577' using the given input > 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 portability between those systems). Linux compatibility *is* an explicit goal of the Cygwin project. If %s 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