Erik Mortis wrote:It was written in Java Script 7(?) years ago by Steph, a HS friend of mine at the time, and still. It uses your computers time, and I'll be damned if I know how it works.
But I wrote a new one in my head a month ago for PHP(I still need to check how to pull up date info), but doubt I'll write it any time soon.
Eh, it's not exactly complex. I even simplified the mathematics a bit while writing the
forum-integrated version. Basically,
Code: Select all
function convertGregToASC(givenDate)
{
return (Math.floor((givenDate - ascStartDate) / 86400000));
}
Where ascStartDate and givenDate are in terms of numbers of milliseconds since the beginning of the Unix epoch (1970-01-01). ascStartDate is, of course, 1999-08-06 (converted to milliseconds into the Unix epoch). 86400000 is the number of milliseconds in a day. That's the full extent of the math, everything else in the original script was glue code or internal results.
* suddenly realises it doesn't really make any sense to call that function convertGregToASC when it's actually independent of the choice of calendar... then shrugs and leaves it the way it is for now, because it's not breaking anything *
No-one should be without a parasol, Sirocco.