On Tue, 28 Jan 2003, Peter J. Acklam wrote: > [EMAIL PROTECTED] (Rick Measham) wrote: > > > There are two time periods that do not change: Years (time the > > earth takes to travel around the sun) and Days (time the earth > > take to spin one complete revolution). I'd suggest that these > > the the two values that DateTime keeps internally. The 'year' > > would be an integer delta from some Epoch (BC/1970) and the > > 'day' would be a float representing how many days since the > > start of the year value. > > Different calendars have very different ideas about what is a > year, but pretty much every calendar has the notion of a day, so > I'd go for using just the day and time of day. > > An example: > > Store the date as an array of two integers [N1, N2], where N1 is > the days since some fixed date and N2 is the time of day. Then, > even if both N1 and N2 must be in the interval [-2^31, 2^31-1] (to > avoid overflow), you can let N2 be the nanoseconds, and thus one > can represent any point in time within more than +/-5 million > years with nanosecond precision using integers only!
Yes, that's how we're doing it, and is how we have been doing it for a long long time. It's the format that I recommended in an earlier note (Julian date, plus another number for time) and which we subsequently implemented in Date::ICal. -- Rich Bowen - [EMAIL PROTECTED] ... and another brother out of his mind, and another brother out at New York (not the same, though it might appear so) Somebody's Luggage (Charles Dickens)