I have worked with Bangla date a long time ago. The first initiative was to make a extension for forum engine punBB. After that, i made a javascript widget to display Bangla date in any site. The third initiative was to make a facebook application that shows current Bangla date to your facebook profile.
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.
Usage:
[php]
<?php
include_once ‘class.banglaDate.php’;
$bn_date = new BanglaDate(time());
$date = $bn_date->get_date();
?>
[/php]
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.
Class Constructor:
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 set_time()
like $bn_date->set_time(time(), 4);
Great, now you made it easier. will use it whenever i have to…
Thanks Junal vai. Yeah, use it whenever it needs đ
Nice! Thanks vai!
Great work. Thanks.
But you made same mistake again. Spelling mistake of “āĻ āĻā§āϰāĻšāĻžā§āύ“.
āĻšāĻžā§ āĻšāĻžā§, āĻāĻāύāĻŋ āĻ āĻŋāĻ āĻāϰ⧠āĻĻāĻŋāĻā§āĻāĻŋāĨ¤ āϧāύā§āϝāĻŦāĻžāĻĻ āĻāĻžāύāĻžāύā§āϰ āĻāύā§āϝā§
That’s great man. I will try to use this with a joomla plugin to show bangla calender date with it.
Yeah, sure đ
I have added ur fb application on my fb profile. thanks for creating this.
Wow!!!
Great work! At past I thought that you are going to be a PHP Guru. But after doing this great work (I mean now), now you are really a PHP Guru. đ
Thanks
Great work!
I’ll test it tonight.
gr8 work!
Works fine.
I’m testing here.
http://khulnajournal.com/
Just one thing, Date converts assuming Bangladesh time as GMT+7.
when i use this class bangla fonts displayed as unknown Symbol.
I use Font SolaimanLipi as unicode font . So how can i use ur class as unicode fonts.
āĻāĻžāĻ āĻāĻ āĻ¤ā§ ā§¨ā§Ž āĻĢāĻžāϞā§āĻā§āύ ā§§ā§Ēā§§ā§Ž , āĻāĻŋāύā§āϤ⧠āĻāĻāĻž āĻĻā§āĻāĻžā§ ā§¨ā§ āĻĢāĻžāϞā§āĻā§āύāĨ¤ āϞāĻŋāĻĒ-āĻā§āĻžāϰā§āϰ āĻāύā§āϝ āĻāĻŋ āϏāĻŽāϏā§āϝāĻžāĻāĻž āĻšāϞā§?
āĻāĻžāĻ āĻĻā§āĻž āĻāϰ⧠āĻāĻāĻž āϏāĻŽāĻžāϧāĻžāύ āĻāϰ⧠āĻĻā§āύ, āĻāĻŽāĻŋ āĻāĻĒāύāĻžāϰ āĻāĻžāĻāĻžāϏā§āĻā§āϰāĻŋāĻĒā§āĻ āĻā§āĻĄ āĻāĻž āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻāϰāĻŋāĨ¤
It’s fixed now. Thanks for reporting đ
āĻ āύā§āĻ āϧāύā§āϝāĻŦāĻžāĻĻ āĻāĻžāĻāĨ¤
āĻāϰā§āĻāĻāĻž āϏāĻžāĻšāĻžāϝā§āϝ āĻāĻžāĻāĻŦā§, āĻāĻŽāĻŋ āĻĒāĻŋāĻāĻāĻāĻĒāĻŋ āĻā§āĻĄāĻāĻž āϰāĻžāύ āĻāϰāĻžāϞ⧠āĻāĻŽāύ āĻāϏā§āĻ Array ( [0] => ā§¨ā§Ž [1] => āĻĢāĻžāϞā§āĻā§āύ [2] => ā§§ā§Ēā§§ā§Ž )
āĻāĻŋāύā§āϤ⧠āĻāĻĒāύāĻžāϰāĻāĻž āĻāϏ⧠āĻāĻāĻžāĻŦā§āĻ document.write(‘āĻāĻ ā§¨ā§Ž āĻĢāĻžāϞā§āĻā§āύ ā§§ā§Ēā§§ā§Ž āĻŦāĻā§āĻāĻžāĻŦā§āĻĻ’);
document.write(‘āĻāĻ ā§¨ā§Ž āĻĢāĻžāϞā§āĻā§āύ ā§§ā§Ēā§§ā§Ž āĻŦāĻā§āĻāĻžāĻŦā§āĻĻ’); āĻāĻāĻžāĻŦā§ āĻāύāϤ⧠āĻšāϞ⧠āĻāĻŋ āĻāϰāϤ⧠āĻšāĻŦā§, āϝāĻĻāĻŋ āϏāĻŽā§ āĻšā§ āϤāĻžāĻšāϞ⧠āĻāĻāĻā§ āϏāĻžāĻšāĻžāϝā§āϝ āĻāϰāĻŦā§āύ āĻĒā§āϞāĻŋāĻāĨ¤
āĻā§āĻžāĻšā§………
āĻšā§ā§ āĻā§āĻā§ āĻāĻžāĻ, āĻāĻāĻā§ āĻ āύā§āϝ āĻāĻžāĻŦā§ āĻāϰā§āĻāĻŋ, āĻāϰā§āϰ āĻŽāĻžāϧā§āϝāĻŽā§ āϰāĻŋāĻāĻžāϰā§āύ āύāĻž āĻāϰ⧠āĻ āύā§āϝ āĻāĻžāĻŦā§ āĻāϰāϞāĻžāĻŽ, āĻĻāĻžāϰā§āύ āĻāĻžāĻ āĻāϰāĻā§āĨ¤
āĻāĻŦāĻžāϰ⧠āϧāύā§āϝāĻŦāĻžāĻĻ āĻāϤ⧠āĻāĻžāϞ⧠āĻāĻāĻāĻž āĻāĻžāĻ āĻāĻĒā§āύ āĻāϰ⧠āĻĻā§āĻā§āĻžāϰ āĻāύā§āϝāĨ¤
āĻāĻāύ āĻĨā§āĻā§ āĻāĻŽāĻŋ āύāĻŋāĻā§āϰ āĻšā§āϏā§āĻ āĻĨā§āĻā§āĻ āĻŦāĻžāĻāϞāĻž āϤāĻžāϰāĻŋāĻ āĻĻā§āĻāĻžāϤ⧠āĻĒāĻžāϰāĻŦā§……
can you please tell how will i be able to print as “ā§¨ā§Ž āĻĢāĻžāϞā§āĻā§āύ ā§§ā§Ēā§§ā§Ž” format NOT in a array like “Array ( [0] => ā§¨ā§Ž [1] => āĻĢāĻžāϞā§āĻā§āύ [2] => ā§§ā§Ēā§§ā§Ž )”
[php]$bn = new BanglaDate(time(), 0);
$bdt = $bn->get_date();
$text = sprintf( ‘āĻāĻ %s’, implode( ‘ ‘, $bdt ) );
echo $text;[/php]
thanks a lot đ
Tareq vai,
i used
$bn = new BanglaDate(time(), 0);
but the date still not changing at 12′ o’clock
can you help?
Hello,
I have a problem when i run this script in my IIS server.
Here output screenshot: http://s10.postimg.org/oxr4o4nrt/sublime.png
how can i solve this problem?
my server config:
OS: Windows 8
Server IIS 8
PHP Version: 5.4.13
Please give me some solution.
Thanks for this great work.
My problem get solved. can you help me to show time in bangla?
Thank you very much for the class…
I would like to know, how do I used bengali letter in web i mean integrate bangla into web site…
I used unicode but not worked in Linux server…
rgds, Mamun
nice works, thanks for share
āĻĻāĻžāϰā§āύ āĻāĻāĻāĻž āĻĒā§āώā§āĻāĨ¤ āϤāĻŦā§ āĻāĻŽāĻžāϰ āĻāĻāĻāĻž āĻĒāĻŋāĻāĻāĻāĻĒāĻŋ āύāĻŋāĻāĻ āϏāĻžāĻāĻā§āϰ āĻāύā§āϝ āĻāĻāϰā§āĻā§, āĻŦāĻžāĻāϞāĻž āĻāĻŦāĻ āĻāϰāĻŦā§ āϤāĻžāϰāĻŋāĻ āĻŦāĻžāĻāϞāĻžāϤ⧠āĻĻā§āĻāĻžāύ⧠āĻĒā§āϰā§ā§āĻāύ āĻāĻŋāϞāĨ¤ āϏā§āĻāύā§āϝ āĻāĻŽāĻŋ āĻ āύāϞāĻžāĻāύ⧠āĻāϰ⧠āĻāĻŋāĻā§ āϏā§āĻā§āϰā§āĻĒā§āĻ āĻĒā§ā§ā§āĻāĻŋāĨ¤ āϏā§āĻā§āϞā§āĻ āĻĻāĻžāϰā§āύ āĻāĻžāĻ āĻāϰāĻā§āĨ¤ āϝā§āĻŽāύāĻ
tareq bhai āĻāĻ āĻĻāĻŋāύ āĻŦā§āĻļā§ āĻšāĻā§āĻā§ āĻā§āύ? āϝā§āĻŽāύ āĻāĻ ā§Ē āĻŦā§āĻļāĻžāĻ ā§§ā§Ē⧍⧧ āĻĻā§āĻāĻžāĻā§āĻā§ āĻāĻŋāύā§āϤ⧠āĻāĻ ā§ŠāϰāĻž āĻŦā§āĻļāĻžāĻ ā§§ā§Ē⧍⧧
āĻāĻžāϰāĻŖ āĻāĻāĻā§ ā§Ē āϤāĻžāϰāĻŋāĻ, ā§Š āϤāĻžāϰāĻŋāĻ āύāĻž đ
āĻĻā§āĻž āĻāϰ⧠āĻāĻ āϏāĻžāĻāĻ āĻāĻž āĻĻā§āĻāϞ⧠āĻāĻĒāύāĻžāϰ āϤāĻžāϰāĻŋāĻā§āϰ āĻĒāĻžāϰā§āĻĨāĻā§āϝ āĻŦā§āĻāϤ⧠āĻĒāĻžāϰāĻŦā§āύ-
http://www.kanchanmoni.com/baisakh.html
āĻāϞāĻāĻžāϤāĻžāϰ āĻŦāĻžāĻāϞāĻž āϤāĻžāϰāĻŋāĻ āĻāϰ āĻŦāĻžāĻāϞāĻžāĻĻā§āĻļā§āϰ āĻŽāϧā§āϝ⧠āĻĒāĻžāϰā§āĻĨāĻā§āϝ āĻāĻā§āĨ¤ āĻŦāĻžāĻāϞāĻž āĻāĻāĻžāĻĄā§āĻŽāĻŋāϰ āĻšāĻŋāϏāĻžāĻŦ āĻ āύā§āϝāĻžā§ā§ āĻŦāĻžāĻāϞāĻž āϤāĻžāϰāĻŋāĻāĻā§ āύāĻŋāϰā§āĻĻāĻŋāώā§āĻ āĻāϰ⧠āĻĻā§ā§āĻž āĻšā§ā§āĻā§, āĻ āĻĒāϰāĻĻāĻŋāĻā§ āĻāϞāĻāĻžāϤāĻžā§ āĻāĻžāĻāĻĻā§āϰ āĻāĻĒāϰ āĻāĻŋāϤā§āϤāĻŋ āĻāϰ⧠āĻŦāĻžāĻāϞāĻž āϤāĻžāϰāĻŋāĻ āύāĻŋāϰā§āϧāĻžāϰāĻŖ āĻāϰāĻž āĻšā§āĨ¤ āĻāĻāĻžāύā§āĻ āĻā§āϞāĻŽāĻžāϞ āĻĒā§āĻā§āĻā§āĨ¤
I had installed the Bangla date class and it was working perfectly. In the last few days it is displaying some characters like à ÂĻâ à ÂĻŠà §§à §ÂĢ Ã ÂĻÅà §Âà ÂĻ¯à §Ëà ÂĻÂˇÃ Â§Âà ÂĻ Ã Â§Â§Ã Â§ÂĒà §¨à §§ à ÂĻÂŦà ÂĻâĸà §Âà ÂĻâà ÂĻžà ÂĻÂŦà §Âà ÂĻÂĻ ( http://www.ettrika.com/ettrika-display.php ) . even the direct link http://tareq.wedevs.com/bangla_date_widget.php is displaying the same. I am using
Also, Download Bangla Date Class above this page is not working. Could you please guide us. Is there a way to have the class and run it without direct URL link ?
Works perfectly here.

May be you didn’t include the meta tag in your html page? [html][/html][html][/html]
I could’t find the class.Can you please give me a link for download the class?
ā§§ā§Š āϰāĻŦāĻŋāĻāϞ āĻāĻāϝāĻŧāĻžāϞ please help for this example
my result this
āĻŦā§āϧāĻŦāĻžāϰ, 7 āĻāĻžāύā§āϝāĻŧāĻžāϰāĻŋ 2015, 8:30:11
But i want to
āĻŦā§āϧāĻŦāĻžāϰ, ā§ āĻāĻžāύā§ā§āĻžāϰ⧠⧍ā§Ļā§§ā§Ģ, ā§ŽāĻā§Šā§ĻāĻā§§ā§§
thanks
may be you can use
str_replace()
for that.Sir I am sorry for saying that ,
I used this without your permission in a tutorial.
https://phpans.com/bangla-date-and-time-in-php
sorry for that.
No problem using the code, but mentioning the link to the original code would help others to find out the source and the original author will be happy too đ
I am showing bangla blog site post date(time_ago();)function but one problem only show 2 .i want to show bengle font that like(⧍)—plz help