From owner-freebsd-hackers Thu Nov 30 14:00:59 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA26551 for hackers-outgoing; Thu, 30 Nov 1995 14:00:59 -0800 Received: from colin.muc.de (colin.muc.de [193.174.4.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id OAA26542 for ; Thu, 30 Nov 1995 14:00:46 -0800 Received: from [193.174.4.22] ([193.174.4.22]) by colin.muc.de with SMTP id <86030-2>; Thu, 30 Nov 1995 11:32:17 +0100 Message-Id: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Date: Thu, 30 Nov 1995 11:33:28 +0100 To: jkh@freefall.freebsd.org From: lutz@muc.de (Lutz Albers) Subject: Re: Bug in stable/-current perl? Cc: freebsd-hackers@freefall.freebsd.org Sender: owner-hackers@FreeBSD.ORG Precedence: bulk In article <199511290543.VAA13120@freefall.freebsd.org>, Jordan K. Hubbard writes: - -jkh@freefall-> date -Tue Nov 28 21:42:48 PST 1995 - -jkh@freefall-> perl -e 'printf("%02.2d\n", (localtime())[3]);' -28 -jkh@freefall-> perl -e 'printf("%02.2d\n", (localtime())[4]);' -10 -jkh@freefall-> perl -e 'printf("%02.2d\n", (localtime())[5]);' -95 - -10? Am I misunderstanding something fundamental about perl's -localtime() call, or should this be an "11"? 10 is correct. Both monthnames and daynames are zero-based (0..11,0..6) in perl. They can be used as offsets in a arry holding month/daynames that way (well, that's th excuse from the camel book). ciao lutz --------------------------------------------------------------------- Lutz Albers | What's good ? Luederitzstr. 14, 81929-Muenchen, Germany | Life's good - email:lutz@muc.de ph: +49-89-93940364 | But not fair at all http://www.muc.de/~lutz fax:+49-89-93940365 | (Lou Reed) Do not take life too seriously, you will never get out of it alive.