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
You want see the tips of win Klik here https://shamimnasir.com/