From owner-freebsd-questions Wed Dec 17 19:34:30 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id TAA12775 for questions-outgoing; Wed, 17 Dec 1997 19:34:30 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from BIGFUN.vwcom.com (BIGFUN.vwcom.com [151.197.101.21]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id TAA12587 for ; Wed, 17 Dec 1997 19:31:24 -0800 (PST) (envelope-from bmc@WillsCreek.COM) Received: from WillsCreek.COM (gw.willscreek.com [151.197.101.46]) by BIGFUN.vwcom.com (8.8.6/8.8.6) with ESMTP id VAA09469; Wed, 17 Dec 1997 21:52:09 -0500 (EST) Received: from current.willscreek.com (current.willscreek.com [172.16.87.1]) by WillsCreek.COM (8.8.7/8.8.5) with ESMTP id VAA20202; Wed, 17 Dec 1997 21:57:03 -0500 (EST) Received: (from bmc@localhost) by current.willscreek.com (8.8.7/8.8.5) id VAA00472; Wed, 17 Dec 1997 21:57:01 -0500 (EST) Date: Wed, 17 Dec 1997 21:57:01 -0500 (EST) Message-Id: <199712180257.VAA00472@current.willscreek.com> From: Brian Clapper MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: "Joe \"Marcus\" Clarke" Cc: questions@freebsd.org Subject: Re: Y2K In-Reply-To: References: X-Mailer: VM 6.23 under Emacs 19.34.1 Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Joe "Marcus" Clarke wrote: > Hey, I know that most unices will be Y2K compatible. They use time_t to > keep time, blah, blah.... But my question is the `date` command. Date > will only let you set the date with a 2-digit year. How will date > handle 00? Will it know to make it 2000, or will it use .....I just > tried it....it DOES make the date 2000. That answers my question. Hats > off, again, to the team at FreeBSD. You guys think of everything. I know you've satisfied yourself that things are okay, but I need to point out an incorrect comment in your message (if only to satisfy the pedant in me). date(1) will, in fact, permit you to specify a 4-digit date. I quote from the man page: -f Use fmt as the format string to parse the date provided rather than using the default [[[[yy]mm]dd]HH]MM[.ss] format. Parsing is done using strptime(3). strptime(3) is to strftime(3) as scanf(3) is to printf(3): That is, strptime() will parse a date string using the '%' escapes recognized by strftime(). (If I recall, strptime() is an X/Open-specified routine.) For example: (current) ~ > sudo date -f '%Y' 2001 Password: Mon Dec 17 21:54:48 EST 2001 (current) ~ > cal 12 2001 December 2001 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 (current) ~ > sudo date -f '%Y' 1997 Password: Wed Dec 17 21:54:55 EST 1997 ----- Brian Clapper, bmc@WillsCreek.COM, http://WWW.WillsCreek.COM/ It is not true that life is one damn thing after another -- it's one damn thing over and over. -- Edna St. Vincent Millay