Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Aug 1998 18:26:24 -0500 (CDT)
From:      Joel Ray Holveck <joelh@gnu.org>
To:        brett@lariat.org
Cc:        mike@smith.net.au, mike@smith.net.au, hackers@FreeBSD.ORG
Subject:   Re: 64-bit time_t
Message-ID:  <199808132326.SAA08388@detlev.UUCP>
In-Reply-To: <4.1.0.44.19980813150058.03f4dd80@127.0.0.1> (message from Brett Glass on Thu, 13 Aug 1998 15:03:05 -0600)
References:  <199808131752.LAA13123@lariat.lariat.org> <4.1.0.44.19980813150058.03f4dd80@127.0.0.1> 

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

You use multiple format constantly.  For instance, strtol is a common
operation when reading configuration files.  If you are manipulating
dates, use a lower-precision format, such as number of days since the
epoch, or alternately since 01 Jan 0000, or whatever.  Then, in your
calls to ctime or strftime or whatever, simply convert it.  (Use
#defines.  Use weak symbols.  Use alternate names, like my_ctime or
whatever.)  It's not different than having to translate between
ASCII-encoded numbers and binary-encoded numbers every time you read
an ASCII config file.

Happy hacking,
joelh

PS: Check your MUA.  It seems to be generating invalid "References:"
lines, ie (line break added by yours truly):

References: <Your message of "Thu, 13 Aug 1998 11:41:05 MDT."
    <199808131752.LAA13123@lariat.lariat.org> 


-- 
Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped

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?199808132326.SAA08388>