delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/07/23/22:10:09

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:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=H3e
jRuofdeRSPBk08ZA0kCVm3Lh5uRA0j5eMvY1qels61XHl/ZaZYDIHn/wZOuK6Pdf
fgO5/H9b3VyvD9bZkId28UO8gk+wfhrUT8aXI492k+sxkYytfAHeyoPg6vFYihAb
HJ0is0Dlvdgc39dOTizcVLBkz/ibiYhrJLnLBIPw=
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:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=QrGL9+0jf
IcJrpaZGIgCWDpvdvk=; b=aKyX8gwmQmr75BuX5lgyVdJ39eH1wdY9ziC1hYEm/
A9vFlegGCzhwUjThxPLEH8J1LF0kzb9weqjNDeeEylN/KeNeaY6Owv3lq7JPFfiQ
7+a+E5BGO87kF46PpJUD41MUarVF180CBnUYPDV0E3EXv6oULQU62BVsK2pOShKf
w0=
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=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:813, contractor
X-HELO: nihcesxway.hub.nih.gov
X-SBRS-Extended: Low
X-IronPortListener: ces-out
From: "Lavrentiev, Anton (NIH/NLM/NCBI) [C]" <lavr AT ncbi DOT nlm DOT nih DOT gov>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Cygwin strptime() is missing "%s" which strftime() has
Date: Mon, 24 Jul 2017 02:09:46 +0000
Message-ID: <BY1PR09MB0343663DE41D927E67CF0CCEA5BB0@BY1PR09MB0343.namprd09.prod.outlook.com>
authentication-results: spf=none (sender IP is ) smtp.mailfrom=lavr AT ncbi DOT nlm DOT nih DOT gov;
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1;BY1PR09MB0342;7:XQvRHSCo9tJk5GBs2ggNDXfe5C09TWg9zAyA51e6vFO0DGdrHq97m/YG9EOvpclAB8T8DzUasOaGYgd5cffDr3nh9W63elfKcmof0mIydXTKFqi2TzJpvOPvHr+jYnkTgcSHeMKDsPLdAz8i3gKJq5n6wXKMdil0Xl/Y27BdnejTPaV1PWXBqKfLhLfoqtbx8tNgCd9em8ka2vUyIHYjFh7TxR3CDj7il5T22Tvkb1VtuIDr7Lq+/xm1SwgkFOcoL69EU2znyroVffo5HlGd5mj7ZCFhCmNvUFMBJZWg2UMc9PO35IAZJntbjPfiFGpIoldNkz3nlv8sH/UllU0ii8OHo30N4kUin627033PVMHeV0hI1RjLTqif88oepAkEtkWNDOzRwZAfAg1Ff9//wM6pWmObEOb1GCDbt2QcbJSIF9Qwdg1Lp08Wrq7MOSNhShuNS6pGBkdP65BpWdM2cm8AW5j4gClz0kLDlxmOA9Dm5h2QsBZjrdVM8P6L9I9WsHcxg52TdKnUW8FCEXT5oPvF9H1AhVOCTLtYkMOWzUl3UotxDIi65uFMju5xKU4WdVdObvKGOaDlr6I9VW4U+avXKi3FSzUeQMSquE0V+fXSghGYhpITr8AcnLnQfsnus1TQiThIQIS34u1DPIg2JvCft34neF5CvT8+arfdt81c00320HaZPCI4ayFr1/y3HFz8Yd9grG1B3RHd7rSOmUUVbwh7IGy30Q7kba863ac3cv+yHc6AXN7ltaJKpxCJgVNN2U//ljZ6DEldN+3cERrSL7JgoForVvMel8GqfbU=
x-ms-office365-filtering-correlation-id: 349d7cbd-a035-41d1-eb74-08d4d2390eb0
x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BY1PR09MB0342;
x-ms-traffictypediagnostic: BY1PR09MB0342:
x-exchange-antispam-report-test: UriScan:;
x-microsoft-antispam-prvs: <BY1PR09MB0342F32D28569EFA68378499A5BB0 AT BY1PR09MB0342 DOT namprd09 DOT prod DOT outlook DOT com>
x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(20161123560025)(20161123558100)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BY1PR09MB0342;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BY1PR09MB0342;
x-forefront-prvs: 0378F1E47A
x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39840400002)(39400400002)(39850400002)(39410400002)(199003)(189002)(102836003)(97736004)(74316002)(7696004)(77096006)(6506006)(189998001)(101416001)(54356999)(86362001)(5660300001)(14454004)(6116002)(3846002)(50986999)(2501003)(2906002)(1730700003)(55016002)(8936002)(81156014)(8676002)(5640700003)(81166006)(6436002)(105586002)(53936002)(305945005)(7736002)(25786009)(3280700002)(68736007)(106356001)(99286003)(33656002)(38730400002)(110136004)(229853002)(6916009)(66066001)(42882006)(3660700001)(2351001)(478600001)(2900100001)(9686003)(6246003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR09MB0342;H:BY1PR09MB0343.namprd09.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jul 2017 02:09:46.6433 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 14b77578-9773-42d5-8507-251ca2dc2b06
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR09MB0342
X-OriginatorOrg: ncbi.nlm.nih.gov
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v6O2A8PP010250

> 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

Thank you,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019