PHP code example of akr4m / bangla-datetime-format

1. Go to this page and download the library: Download akr4m/bangla-datetime-format 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/ */

    

akr4m / bangla-datetime-format example snippets



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

e(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 BanglaDatetimeFormat\Types\DateTime as EnDateTime;


use BanglaDatetimeFormat\Types\DateTime;

Asia/Dhaka'));

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



use BanglaDatetimeFormat\Types\DateTime;

Asia/Dhaka'));

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



use BanglaDatetimeFormat\Types\BnDateTime;

ne('Asia/Dhaka'));

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



use BanglaDatetimeFormat\Types\BnDateTime;

ne('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');