PHP code example of ronisaha / easy-bangla-date

1. Go to this page and download the library: Download ronisaha/easy-bangla-date library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ronisaha / easy-bangla-date example snippets



use EasyBanglaDate\Types\BnDateTime;
use EasyBanglaDate\Types\DateTime as EnDateTime;

abda->setDate(1398, 1, 1);

echo $bongabda->format('l jS F Y b h:i:s') . PHP_EOL ;
echo $bongabda->enFormat('l jS F Y h:i:s a') . PHP_EOL;
echo $bongabda->getDateTime()->format('l jS F Y b h:i:s'). PHP_EOL;
echo $bongabda->getDateTime()->enFormat('l jS F Y h:i:s A') . PHP_EOL;







use EasyBanglaDate\Types\DateTime as EnDateTime;


use EasyBanglaDate\Types\DateTime;

Zone('Asia/Dhaka'));

echo $date->format('l jS F Y b h:i:s');



use EasyBanglaDate\Types\DateTime;

Zone('Asia/Dhaka'));

echo $date->enFormat('l jS F Y b h:i:s');



use EasyBanglaDate\Types\BnDateTime;

TimeZone('Asia/Dhaka'));

echo $bongabda->format('l jS F Y b h:i:s');



use EasyBanglaDate\Types\BnDateTime;

TimeZone('Asia/Dhaka'));

echo $bongabda->format('l jS F Y b h:i:s');
//Set Bengali date
$bongabda->setDate(1405,1,1);
//Get english date in bangla
echo $bongabda->getDateTime()->format('l jS F Y b h:i:s');
//Get english date in english
echo $bongabda->getDateTime()->enFormat('l jS F Y h:i:s');