From owner-freebsd-hackers Fri Mar 8 13:46:31 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by hub.freebsd.org (Postfix) with ESMTP id C2F6C37B402 for ; Fri, 8 Mar 2002 13:46:28 -0800 (PST) Received: from blossom.cjclark.org ([12.234.91.48]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020308214628.OFHI1147.rwcrmhc52.attbi.com@blossom.cjclark.org>; Fri, 8 Mar 2002 21:46:28 +0000 Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.6) id g28LkRi14094; Fri, 8 Mar 2002 13:46:27 -0800 (PST) (envelope-from cjc) Date: Fri, 8 Mar 2002 13:46:27 -0800 From: "Crist J. Clark" To: Michael Stevens Cc: perlbug@perl.com, hackers@FreeBSD.ORG Subject: Re: bug in Time::Local (can't handle 1901) Message-ID: <20020308134627.F57999@blossom.cjclark.org> References: <20020308164115.C2A165D02D@penfold.unixbeard.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020308164115.C2A165D02D@penfold.unixbeard.net>; from mstevens@seshat.demon.co.uk on Fri, Mar 08, 2002 at 04:41:15PM +0000 X-URL: http://people.freebsd.org/~cjc/ Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Mar 08, 2002 at 04:41:15PM +0000, Michael Stevens wrote: > This is a bug report for perl from mstevens@etla.org, > generated with the help of perlbug 1.26 running under perl 5.00503. > > > ----------------------------------------------------------------- > [Please enter your report here] > > michaels@host:~> perl -MTime::Local -e 'timegm(0,0,0, 01, 01, 1901)' > Can't handle date (0, 0, 0, 1, 1, 1) at -e line 1 > > This seems contrary to the documentation which suggests that this is > a perfectly valid date that will be handled as 1901. It so happens that the 2^31 seconds before the UNIX epcoh falls on Fri Dec 13 20:45:52 UTC 1901. $ date -ju 190112132045.52 Fri Dec 13 20:45:52 UTC 1901 $ date -ju 190112132045.51 date: nonexistent time $ date -ju 190112132045.52 +%s -2147483648 $ dc 2 31^ p 2147483648 mktime(3) will choke on dates before Fri Dec 13 20:45:52 UTC 1901. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message