The RSS Feeds here at chronolabs have recently had a new calendar, when I asked a swarmi who studies the calendar I think like me it is better was as a watch as deficent calendar, I might sit down one time with some PDF and work out the none dificent calendar which in the 60 Cycle period contains 5 and 4 days.
function VedicCalendar($unix_time, $gmt, $poffset = '1970-01-12 12:00 PM', $pweight = '-49183.75', $defiency='deficient', $timeset= array("hours" => 24, "minutes" => 60, "seconds" => 60)) { // Code Segment 1 – Calculate Floating Point $tme = $unix_time; if ($gmt>0){ $gmt=-$gmt; } else { $gmt=abs($gmt); } $ptime = strtotime($poffset)+(60*60*$gmt); $weight = $pweight+(1*$gmt); $roun_xa = ($tme)/(24*60*60); $roun_ya = $ptime/(24*60*60); $roun = (($roun_xa -$roun_ya) - $weight)+(microtime/999999); // Code Segment 2 – Set month day arrays $deficient = array( "seq1" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq2" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq3" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq4" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq5" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq6" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq7" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq8" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq9" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq10" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq11" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq12" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq13" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq14" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq15" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq16" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq17" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq18" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq19" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq20" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq21" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq22" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq23" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq24" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq25" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq26" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq27" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq28" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq29" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq30" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq31" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq32" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq33" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq34" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq35" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq36" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq37" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq38" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq39" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq40" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq41" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq42" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq43" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq44" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq45" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq46" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq47" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq48" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq49" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq50" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq51" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq52" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq53" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq54" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq55" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq56" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq57" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq58" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq59" => array(27,27,27,27,27,27,27,27,27,27,27,27), "seq60" => array(27,27,27,27,27,27,27,27,27,27,27,27)); $daynames = array( 'Vishkumbha','Prīti','Āyushmān','Saubhāgya','Shobhana', 'Atiganda','Sukarman','Dhriti','Shūla','Ganda','Vriddhi', 'Dhruva', 'Vyāghāta', 'Harshana', 'Vajra', 'Siddhi', 'Vyatīpāta', 'Varigha', 'Parigha', 'Shiva', 'Siddha', 'Sādhya', 'Shubha', 'Shukla', 'Brāhma', 'Māhendra', 'Vaidhriti'); $monthnames = array('Chaitra', 'Vaishākh', 'Jyaishtha', 'Āshādha', 'Shrāvana', 'Bhaadra', 'Āshwin', 'Kārtik', 'Agrahayana', 'Paush', 'Māgh', 'Phālgun'); $monthusage = isset($defiency) ? ${$defiency} : $deficient; // Code Segment 3 – Calculate month number, day number, day count etc foreach($monthusage as $key => $item){ $i++; foreach($item as $numdays){ $ttl_num=$ttl_num+$numdays; $ttl_num_months++; } } // You need to replace this section in Function EgyptianCalendar // As well as Function MayanTihkalCalendar $revolutionsperyear = $ttl_num / $i; $numyears = floor((ceil($roun) / $revolutionsperyear)); $avg_num_month = $ttl_num_months/$i; $jtl = abs(abs($roun) - ceil($revolutionsperyear*($numyears+1))); while($month==0){ $day=0; $u=0; foreach($monthusage as $key => $item){ $t=0; foreach($item as $numdays){ $t++; $tt=0; for($sh=1;$sh<=$numdays;$sh++){ $ii=$ii+1; $tt++; if ($ii==floor($jtl)){ if ($roun<0){ $daynum = floor($tt); $month = floor($t); } else { $daynum = floor($numdays-($tt-1)); $month = floor($avg_num_month-($t-1)); } $sequence = $key; $nodaycount=true; } } if ($nodaycount==false) $day++; } $u++; } } //$numyears = abs($numyears); $timer = substr($roun, strpos($roun,'.')+1,strlen($roun)-strpos($roun,'.')-1); $roun_out= $numyears.'/'.$month.'/'.$daynum.' '.$day.'.'. floor(intval(substr($timer,0,2))/100*$timeset['hours']).':'. floor(intval(substr($timer,2,2))/100*$timeset['minutes']).':'. floor(intval(substr($timer,4,2))/100*$timeset['seconds']).'.'.substr($timer,6,strlen($timer)-6); $verdic_obj = array('stardate'=>"$numyears.$day", 'year'=>$numyears,'month'=>$month, 'mname' => $monthnames[$month-1], 'dname' => $daynames[$daynum-1],'day'=>$daynum, 'jtl'=>$jtl, 'day_count'=>$day,'hours'=>floor(intval(substr($timer,0,2))/100*$timeset['hours']),'minute'=> floor(intval(substr($timer,2,2))/100*$timeset['minutes']),'seconds'=> floor(intval(substr($timer,4,2))/100*$timeset['seconds']),'microtime'=>substr($timer,6,strlen($timer)-6),'strout'=>$roun_out); return $verdic_obj; }
You can download this code with other calendars from http://time.chronolabs.coop/?gmt=10 for sydney - if you want the code download here : http://bin.chronolabs.coop/time.chronolabs.coop.1.1.zip
|