From owner-freebsd-hackers Wed Nov 29 16:22:54 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA06067 for hackers-outgoing; Wed, 29 Nov 1995 16:22:54 -0800 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id QAA06045 ; Wed, 29 Nov 1995 16:22:40 -0800 Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id BAA16060; Thu, 30 Nov 1995 01:22:26 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id BAA11747; Thu, 30 Nov 1995 01:22:25 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.6.12/8.6.9) id BAA16347; Thu, 30 Nov 1995 01:15:16 +0100 From: J Wunsch Message-Id: <199511300015.BAA16347@uriah.heep.sax.de> Subject: Re: Bug in stable/-current perl? To: jkh@freefall.freebsd.org (Jordan K. Hubbard) Date: Thu, 30 Nov 1995 01:15:16 +0100 (MET) Cc: hackers@freefall.freebsd.org Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199511290543.VAA13120@freefall.freebsd.org> from "Jordan K. Hubbard" at Nov 28, 95 09:43:31 pm X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1627 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk As 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"? j@uriah 199% man 3 localtime CTIME(3) UNIX Programmer's Manual CTIME(3) NAME asctime, ctime, difftime, gmtime, localtime, mktime - transform binary date and time value to ASCII ... External declarations as well as the tm structure definition are in the include file. The tm structure includes at least the following fields: int tm_sec; /* seconds (0 - 60) */ int tm_min; /* minutes (0 - 59) */ int tm_hour; /* hours (0 - 23) */ int tm_mday; /* day of month (1 - 31) */ int tm_mon; /* month of year (0 - 11) */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ int tm_year; /* year - 1900 */ int tm_wday; /* day of week (Sunday = 0) */ int tm_yday; /* day of year (0 - 365) */ int tm_isdst; /* is summer time in effect? */ char *tm_zone; /* abbreviation of timezone name */ long tm_gmtoff; /* offset from UTC in seconds */ -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)