18
Remember 2012 coming soon, if you are wondering the mayan long count calendar reaches 13.0.0.0.0 on 21-12-2012 for the full day..
You can follow the ticker at
http://www.chronolabs.es/time.rss?gmt=10 (sydney time)..
Here is the mayan long count code *** I love STar Trek!!
function MayanLongCount($tme){
$config = array('ppo' => array(13,0,0,0,0),
'epoch' => strtotime('2012-12-21'));
$diff=(($tme-$config['epoch'])/(60*60*24));
$ppo = changemaya($config['ppo'],ceil($diff));
return $ppo[0].'.'.$ppo[1].'.'.$ppo[2].'.'.$ppo[3].'.'.$ppo[4];
}
function changemaya($ppo,$diff){
if ($diff>0) { $amount=1; } else { $amount=-1; }
for ($sh=1;$sh<abs($diff);$sh++){
if ($ppo[4]+$amount>20){
if ($ppo[3]+$amount>20){
if ($ppo[2]+$amount>20){
if ($ppo[1]+$amount>20){
if ($ppo[0]+$amount>20){
$ppo[0]=0;
$ppo[1]=0;
$ppo[2]=0;
$ppo[3]=0;
$ppo[4]=0;
} else {
$ppo[1]=0;
$ppo[0]=$ppo[0]+$amount;
}
} else {
$ppo[2]=0;
$ppo[1]=$ppo[1]+$amount;
}
} else {
$ppo[3]=0;
$ppo[2]=$ppo[2]+$amount;
}
} else {
$ppo[4]=0;
$ppo[3]=$ppo[3]+$amount;
}
} elseif ($ppo[4]+$amount<0){
if ($ppo[3]+$amount<0){
if ($ppo[2]+$amount<0){
if ($ppo[1]+$amount<0){
if ($ppo[0]+$amount<0){
$ppo[0]=20;
$ppo[1]=0;
$ppo[2]=0;
$ppo[3]=0;
$ppo[4]=0;
} else {
$ppo[1]=20;
$ppo[0]=$ppo[0]+$amount;
}
} else {
$ppo[2]=20;
$ppo[1]=$ppo[1]+$amount;
}
} else {
$ppo[3]=20;
$ppo[2]=$ppo[2]+$amount;
}
} else {
$ppo[4]=20;
$ppo[3]=$ppo[3]+$amount;
}
} else {
$ppo[4]=$ppo[4]+$amount;
}
}
return $ppo;
}
Merry Christmas