Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 1998 23:25:09 +0000
From:      Mike Smith <mike@smith.net.au>
To:        Brett Glass <brett@lariat.org>
Cc:        Mike Smith <mike@smith.net.au>, hackers@FreeBSD.ORG
Subject:   Re: 64-bit time_t 
Message-ID:  <199808132325.XAA00422@word.smith.net.au>
In-Reply-To: Your message of "Thu, 13 Aug 1998 15:03:05 CST." <4.1.0.44.19980813150058.03f4dd80@127.0.0.1> 

next in thread | previous in thread | raw e-mail | index | archive | help
> At 12:24 PM 8/13/98 -0700, Mike Smith wrote:
> 
> >> I'd kind of like to do financial projections for my retirement and not
> >> have the calculations blow up, as they do now.
> >
> >time_t is a format for the system current time.  As such, you're abusing
> >it mightily if you expect it to be a general-purpose time value.
> 
> It's used throughout UNIX and UNIX programs as such. And rightfully so;
> it's silly to have multiple date formats.

It's used throughout Unix and Unix programs to represent values of 
'now' which may relate to the system time.  It is abused to represent 
time values which overlap this to some degree.

It is not "silly" to have multiple date formats.  It is *sensible* to 
have multiple date formats, where each format is chosen for suitability 
for its purpose.  time_t is too imprecise for many things (hence struct 
timeval) and too limited in range for others (eg. your application).

Neither of these mean that it's not suited to its correct usage.

> >Might I suggest that you should consider using something with perhaps a 
> >slightly reduced precision, like anyone else that does work involving 
> >longer timeframes?
> 
> This would create an incompatible notation and would make life much more
> difficult than fixing the basic problem.

Surely you jest.  Fixing *just* your application is "much more
difficult" than fixing every other application that uses time_t 
correctly?  I think not.

> >time_t is not a hammer.
> 
> Nope, but I don't intend to carry an entire box of tools to screw in a light
> bulb.... ;-)

Funny, that's what Unix is.  A big box full of tools.  Pick the right 
one for the job, and you'll bruise much less often.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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