From owner-freebsd-hackers Thu Aug 13 16:28:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id QAA09218 for freebsd-hackers-outgoing; Thu, 13 Aug 1998 16:28:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from mail.camalott.com (mail.camalott.com [208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA09037 for ; Thu, 13 Aug 1998 16:28:05 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-76.camalott.com [208.229.74.76]) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id SAA20714; Thu, 13 Aug 1998 18:28:31 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.9.1/8.9.1) id SAA08388; Thu, 13 Aug 1998 18:26:24 -0500 (CDT) (envelope-from joelh) Date: Thu, 13 Aug 1998 18:26:24 -0500 (CDT) Message-Id: <199808132326.SAA08388@detlev.UUCP> To: brett@lariat.org CC: mike@smith.net.au, mike@smith.net.au, hackers@FreeBSD.ORG 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) Subject: Re: 64-bit time_t From: Joel Ray Holveck Reply-to: joelh@gnu.org References: <199808131752.LAA13123@lariat.lariat.org> <4.1.0.44.19980813150058.03f4dd80@127.0.0.1> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>> 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: -- 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