AD to BS Coverter [ Nepali to English Date Conveter] [PHP]

Want a PHP Class for Converting AD-BS & BS-AD. Download the file  Download Now!! class.bs-ad.phps  (Imp. rename it to class.bs-ad.php)  and Write the following to use the library

<?php
require_once("class.bs-ad.php"); //downloaded and renamed class file
$ad_bs = new NepaliCalender();
$oz_date = array("oz_year"=>1996,"oz_month"=>06,"oz_day"=>16); //My Birthday :D
$oz_gotBS = $ad_bs-> ad_2_bs($oz_date['oz_year'],$oz_date['oz_month'],$oz_date['oz_day']);
if(is_array($oz_gotBS))
{ echo $oz_gotBS["year"]; echo $oz_gotBS["month"]; echo $oz_gotBS["date"]; echo $oz_gotBS["day"]; echo $oz_gotBS["nmonth"]; echo $oz_gotBS["num_day"];
}
?>
<?php
require_once("class.bs-ad.php"); //downloaded and renamed class file
$ad_bs = new NepaliCalender();
$oz_date = array("oz_year"=>2053,"oz_month"=>03,"oz_day"=>02); //Again My Birthday :D
$oz_gotAD = $ad_bs-> ad_2_bs($oz_date['oz_year'],$oz_date['oz_month'],$oz_date['oz_day']);
if(is_array($oz_gotAD))
{ echo $oz_gotAD["year"]; echo $oz_gotAD["month"]; echo $oz_gotAD["date"]; echo $oz_gotAD["day"]; echo $oz_gotAD["nmonth"]; echo $oz_gotAD["num_day"];
}
?>

Hope This Helps you 🙂

 

Leave a Reply