From owner-freebsd-questions Mon Oct 18 18:56: 2 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id EA444157DC for ; Mon, 18 Oct 1999 18:55:59 -0700 (PDT) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id VAA20341; Mon, 18 Oct 1999 21:59:10 -0400 (EDT) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199910190159.VAA20341@cc942873-a.ewndsr1.nj.home.com> Subject: Re: General Question: System date in FreeBSD 3.x In-Reply-To: <6C37EE640B78D2118D2F00A0C90FCB4401105D0B@site2s1> from Christopher Michaels at "Oct 18, 1999 06:46:03 pm" To: ChrisMic@clientlogic.com (Christopher Michaels) Date: Mon, 18 Oct 1999 21:59:10 -0400 (EDT) Cc: questions@FreeBSD.ORG (FreeBSD Questions (E-mail)) Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Christopher Michaels wrote, > Hi, > This is a general question. I thought that the date/time on a UNIX system, > and in the kernel was tracked in seconds from the epoch (1/1/70). But, > recently I had a problem where cvsup kept dumping core on my friends new > 3.3-release installation. > > What I came to find out was that the system date was set to the year 1904. > Fixing the date resolved this issue, but it brought up the question. How > exactly does FreeBSD keep time internally? Is a negative time allowed? Time is stored as a 'time_t' type which, if you look hard enough in /usr/include, is just a 'long'. It is a signed 4-byte integer. Play with positive and negative UNIX epoch times with 'date -r'. The fact that it is signed is why it will run out in 2^31-1 seconds after Jan 0 1970 in 2038. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message