Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Oct 1999 21:59:10 -0400 (EDT)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        ChrisMic@clientlogic.com (Christopher Michaels)
Cc:        questions@FreeBSD.ORG (FreeBSD Questions (E-mail))
Subject:   Re: General Question: System date in FreeBSD 3.x
Message-ID:  <199910190159.VAA20341@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <6C37EE640B78D2118D2F00A0C90FCB4401105D0B@site2s1> from Christopher Michaels at "Oct 18, 1999 06:46:03 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910190159.VAA20341>