I always wanted to publish this as a PHP Class but never got that chance to do so. After a long time i worked with Bangla date today and finally created a PHP Class to use it anywhere by anyone. Sorry for the late.
<?php include_once 'class.banglaDate.php'; $bn_date = new BanglaDate(time()); $date = $bn_date->get_date(); ?>
You will get an array of converted date in Bangla.
A few things needed to know. Bangla date counted or changes after the sun rise. That means, where English date changes at 12′O clock at the night, Bangla date changes at the morning after the sunrise.
This class constructor has 2 parameters. The first one in timestamp and the second one is the hour of changing the date. If you want to change the Bangla date like English at 12’0 clock at the night, you should use
$bn_date = new BanglaDate(time(), 0). But if you want to change the date at 6′O clock at the morning, use as
$bn_date = new BanglaDate(time(), 6). If you don’t pass the second parameter, the default value is 6. Use as you like.
After Creating the class object, you can set another date using
Bangla Date class on PHPClasses.org