From owner-freebsd-bugs Thu Nov 11 1:20: 4 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 2295D14CA3 for ; Thu, 11 Nov 1999 01:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA97458; Thu, 11 Nov 1999 01:20:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Thu, 11 Nov 1999 01:20:02 -0800 (PST) Message-Id: <199911110920.BAA97458@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Sheldon Hearn Subject: Re: bin/14817: strptime(3) '%C' conversion incorrect Reply-To: Sheldon Hearn Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/14817; it has been noted by GNATS. From: Sheldon Hearn To: cjc@cc942873-a.ewndsr1.nj.home.com Cc: FreeBSD-gnats-submit@FreeBSD.ORG, kevin.ruddy@powerdog.com Subject: Re: bin/14817: strptime(3) '%C' conversion incorrect Date: Thu, 11 Nov 1999 11:19:27 +0200 On Thu, 11 Nov 1999 00:43:29 EST, "Crist J. Clark" wrote: > However, the '%C' conversion does not work as described in strftime(3) > (which strptime(3) references as containing the key for the > conversions), nor does a simple 'date +%C' return what the actual > strptime(3) function wants. I think that strptime(3) does behave as expected. I think you're assuming too much. > struct tm tm; > > strptime("19","%C",&tm); > > printf("%d\n",tm.tm_year); You can't expect tm_year to contain anything sensible after your call to strptime, because you haven't given it enough information. Try using it in conjunction with %g and you'll get sensible results. Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message