Re: gdate integration



Quoting Havoc Pennington (rhpennin@midway.uchicago.edu):

> > I use to work on a "Year 2000 compliance" project. The way to do it is
> > to make the software rely on the ANSI implementation rightness,
> > i.e. use standard date management system. If you do not use these
> > structs + funcs, you do rely on the OS (in a marketing sense) on a
> > date point of view.
> >
> > IMHO, should be better to use (at least internally) the struct tm &
> > its folks.
> >
>
> There's no way to rely on struct tm and ANSI C for the functionality,
> because struct tm and C do not provide the functionality. When they do
> (e.g. for strftime), I've used those functions.
>
> GDate is Y2K compliant though. It actually works up to the year 65535 or
> so. :-) (Though I have no idea why you'd want it to...)

Well, that depends on what you use the date for. When you do a simulation
of a galaxy, then a date in the range of 40bits (10 billion years is
already outside of 32 bits, you'll need 34 if you want the sign). So I'd
base a generic date class on a 48bit year, 24bit for the seconds in the
year and then I need 50bits for the fractions of the second (upto 10^-15
which seems the smallest possible amount of time). That means I need a 122
bit number to store a time. Add one bit for the sign and one for the
"invalid date" then the rest for the fraction (if someone comes up with an
even more accurate method to measure time) and you have a 128bit date which
can store any possible date/time.

--
Dipl. Inf. (FH) Aaron "Optimizer" Digulla     Assistent im BIKS Labor, FB WI
"(to) optimize: Make a program faster by      FH Konstanz, Brauneggerstr. 55
improving the algorithms rather than by       Tel:+49-7531-206-514
buying a faster machine."                     EMail: digulla@fh-konstanz.de



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]