Theiling Online    Sitemap    Conlang Mailing List HQ   

Re: OT: CONCULTURE: Ayeri calendar again

From:Carsten Becker <naranoieati@...>
Date:Monday, January 10, 2005, 17:20
Hey all, especially Mark J. Reed -- I need your help as a
specialist for calendar conversion and -programming!

After I said two or three weeks ago I haven't decided yet a
point 0 in my Ayeri calendar system, I tried to do so
yesterday afternoon. I followed Mark J. Reed's extremely
helpful explanation which was posted on 04/30/2004 02:00
GMT (Thread: "Programming a calendar system")

On Friday 30 April 2004 03:00, Mark J. Reed wrote:

 > So the UNIX epoch occurred at 4874-07-06 at 24:02:60
 > Aréqan time.

So this is where I got: The UNIX epoch occured at 8 days 11
months 1580 years at 23 hours 15 minutes 10 seconds 2
centiseconds according to the sun calendar ("Curan
Cuperin", Sun Count). I just have to repeat the same stuff
for the other, moon-based calendar that is usually used now
("Curan Tertanyan", Tertanyan's Count, called after its
inventor). It'll be much work ... maybe next weekend.

However, the count of the months will not depend on the sun
year anymore but only on the moons. The count of years
(summer solstices) will depend on the sun ... Nah, I guess
it's really better to completely switch the normal count
completely to the moons and only use the sun count for
sciencific stuff. So partly forget about what I said in my
email of last month.

Back to my original question! In his email, Mark describes
what would have to be done to make this programmable with
PHP. And this is the step where I stuck:

 > The math is unworkable if you start in the middle of a
 > cycle, however. So what we really want is the UNIX time_t
 > value of the start of the next tetrad, which is
 > 4877-01-01 00:00:00.  Let's bump up each of our Aréqan
 > units in turn until we get there, keeping track of how
 > much time we add, then convert that back to Earth seconds
 > to get the corresponding time_t value.
 >
 > [...]
 >
 > That's our desired point - the start of a tetrad,
 > 42,375,312 Aréqan seconds after UNIX time 0.   Since each
 > of those Aréqan seconds is 1.2 SI seconds, thats time_t =
 > 42,375,312 x 1.2 = 50,850,374.4 (which happens to be
 > Thursday, August 12, 1971, at 13:06:14 UTC).
 >
 > Now we can implement.  Code to follow.

Why do we need to know this?

In the script Mark Reed mailed to me some time later[1],
there are two lines:

 >    # Correspondence point
 >    $TIME_T_0 = 62772584;  # UNIX time_t of correspondence
 >                           # point  => in days
 >    $AYEAR_0 = 3109;       # Aréqan year of correspondence
 >                           # point

I don't understand where the value for the variable TIME_T_0
comes from -- Days of what and counted from when? From the
calendar's starting point to the start of the UNIX epoch?
Please enlighten me!

BTW, I've added a script I ripped off from one of the many
Gregorian to Julian Date converters on the 'net because
PHP4's gregoriantojd() function sucks. It's to unprecise.
The original script is in Javascript and available at
http://aa.usno.navy.mil/data/docs/JulianDate.html

Thanks,
Carsten


[1] I cannot find it ATM, but it must be there somewhere in
the last week of April or first week of May 2004. I think
he did not send it to me privately, I remember there was a
PHP script once posted to the list. Oh, maybe this is one
of the 3 mails that got lost when I imported all my mail
stuff from Outlook Express into KMail last summer.

--

<?php

# JAVASCRIPT EXTRACTED FROM                  #
# aa.usno.navy.mil/data/docs/JulianDate.html #
# AND TWISTED INTO A PHP4 SCRIPT             #
# ------------------------------------------ #
# Replacement for the inbuilt PHP function   #
# because this method is more precise        #

function greg2jd($era, $y, $m, $d, $h, $mn, $s)
{
if($y == 0) {
die("There is no year 0 in the Julian
     system!");
return "invalid";
}

if($y == 1582 && m == 10 && d > 4 && d < 15 && era == "CE")
{
die("The dates 5 through 14 October,
     1582, do not exist in the
     Gregorian system!");
return "invalid";
}

if($era == "BCE") $y = -$y + 1;
if($m > 2) {
$jy = $y;
$jm = $m + 1;
} else {
$jy = $y - 1;
$jm = $m + 13;
}

$intgr = floor(floor(365.25*$jy) + floor(30.6001*$jm))
$intgr = $intgr + floor($d + 1720995)

//check for switch to Gregorian calendar
$gregcal = 15 + 31*( 10 + 12*1582 );
if( $d + 31*($m + 12*$y) >= $gregcal ) {
$ja = floor(0.01*$jy);
$intgr += 2 - $ja + $floor(0.25*$ja);
}

//correct for half-day offset
$dayfrac = $h/24.0 - 0.5;
if( $dayfrac < 0.0 ) {
$dayfrac += 1.0;
--$intgr;
}

//now set the fraction of a day
$frac = $dayfrac + ($mn + $s/60.0)/60.0/24.0;

    //round to nearest second
    $jd0 = ($intgr + $frac)*100000;
    $jd  = floor($jd0);
    if( $jd0 - $jd > 0.5 ) ++$jd;
    return $jd/100000;
}

?>

The page I have this from also includes the backwards
version. Just replace the "var" by nothing and put a dollar
sign in front of each variable. Replace "alert()" by "echo"
or whatever seems appropriate.

Reply

Mark J. Reed <markjreed@...>