Re: Scaled or Granular Dates

From: Christopher Browne <cbbrowne_at_acm.org>
Date: 12 Jan 2004 20:55:17 GMT
Message-ID: <btv1jl$bjtj9$5_at_ID-125932.news.uni-berlin.de>


Quoth "Marshall Spight" <mspight_at_dnai.com>:
> I generally agree with what you're saying. But:
>
> "Pat Turner" <purpletrousers_at_netscape.net> wrote in message news:jkzMb.177$M4.95_at_newsr2.u-net.net...
>>
>> I know that with this system we would need to have conversion facilities
>> to migrate a Julian Date to a Gregorian date, and indeed we would need a
>> conversion facility from every calender to every other calender, but i
>> don't see that this is a problem.
>
> Honestly, have you ever heard of anyone, anywhere, using anything
> except the Gregorian calendar? I haven't. Sure, I can imagine some
> history prof somewhere needing it, but fringe functionality should
> be exactly that: fringe. It doesn't belong in the core library,
> making a datatype that almost everyone, everywhere has to use on a
> regular basis significantly more complicated. java.util.Calendar is
> massive overkill, and I'd suggest you not treat it as your standard
> of good design. Rather, I think it makes an excellent example of
> throwing in every feature that the designer thought might be cool,
> at the expense of the user.

Ah, but Julian Dates have the REALLY attractive property that they are a simple continuous count of the number of days since the relevant "epoch date," January 1, 4713 BCE.

  • In 32 bits, you can readily store dates from the distant past to the distant future as simple integers.
  • 64 bit FLOATS allow expressing dates to roughly 1ms precision.
  • You can get the day of the week via a simple "date mod 7" function.
  • You can trivially subtract dates from one another and get differences.
  • Date values and intervals are simple values, and they can be manipulated as integers, which can be compiled to REALLY FAST machine code.

It is therefore VERY attractive to use Julian Dates as the physical representation for dates.

This is hardly "fringe functionality."

-- 
wm(X,Y):-write(X),write('_at_'),write(Y). wm('cbbrowne','ntlug.org').
http://www3.sympatico.ca/cbbrowne/lisp.html
"We English-speaking peoples should   keep hold of the essential  fact
about foreign languages: They exist to make us laugh."
-- John Derbyshire
Received on Mon Jan 12 2004 - 21:55:17 CET

Original text of this message