From owner-freebsd-hackers Wed Nov 29 00:21:23 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id AAA20204 for hackers-outgoing; Wed, 29 Nov 1995 00:21:23 -0800 Received: from iis (iis.webnet.com.au [203.8.105.2]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id AAA20196 for ; Wed, 29 Nov 1995 00:21:16 -0800 Received: from jazzy.phase-one.com.au (gw.phase-one.com.au [203.21.35.254]) by iis (8.6.12/8.6.9) with SMTP id TAA19409; Wed, 29 Nov 1995 19:25:29 +1100 Date: Wed, 29 Nov 1995 19:22:48 +1100 (EST) From: Peter Marelas X-Sender: maral@jazzy.phase-one.com.au To: "Jordan K. Hubbard" cc: hackers@freebsd.org Subject: Re: Bug in stable/-current perl? In-Reply-To: <199511290543.VAA13120@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org Precedence: bulk On Tue, 28 Nov 1995, Jordan K. Hubbard wrote: > 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.. yeah i thought it was irish , when i came across it as well...but.. localtime EXPR Converts a time as returned by the time function to a 9-element array with the time analyzed for the local timezone. Typically used as follows: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); All array elements are numeric, and come straight out of a struct tm. In particular this means that $mon has the range 0..11 and $wday has the range ^^^^^ 0..6. If EXPR is omitted, does localtime(time). Peter