From owner-freebsd-stable Sat Jan 1 8:54:21 2000 Delivered-To: freebsd-stable@freebsd.org Received: from mail.svzserv.kemerovo.su (mail.svzserv.kemerovo.su [194.58.85.170]) by hub.freebsd.org (Postfix) with ESMTP id EC5D914CB1 for ; Sat, 1 Jan 2000 08:54:14 -0800 (PST) (envelope-from mail.svzserv.kemerovo.su!iname.com!eugen@mail.svzserv.kemerovo.su) Received: from iname.com (D00015.dialonly.kemerovo.su [194.135.215.134]) by mail.svzserv.kemerovo.su (8.9.3/8.9.3) with ESMTP id XAA00764; Sat, 1 Jan 2000 23:52:50 +0700 (NKZ) (envelope-from eugen@iname.com) Message-ID: <386E311D.6E04DC54@iname.com> Date: Sat, 01 Jan 2000 23:53:49 +0700 From: Eugene Grosbein Organization: SVZServ X-Mailer: Mozilla 4.7 [en] (X11; I; FreeBSD 3.4-STABLE i386) X-Accept-Language: ru, en MIME-Version: 1.0 To: hgoldste@bbs.mpcs.com Cc: freebsd-stable@FreeBSD.ORG Subject: Re: date +%G still thinks it's 1999? References: <14446.11440.328151.913890@penny.n2wx.ampr.org> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Howard Goldstein wrote: > > I'm not sure what I'm doing wrong here :( > > cally:/usr/src/bin/date$ date -u > Sat Jan 1 16:22:45 GMT 2000 > cally:/usr/src/bin/date$ date -u '+%a, %d %b %G %H:%M:%S GMT' > Sat, 01 Jan 1999 16:23:01 GMT > cally:/usr/src/bin/date$ date -u '+%G' > 1999 It's all right. From 'man strftime': ----- %G is replaced by a year as a decimal number with century. This year is the one that contains the greater part of the week (Monday as the first day of the week). %g is replaced by the same year as in ``%G'', but as a decimal number without century (00-99). ----- You should use %Y to obtain 2000. Eugene Grosbein. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message