Giter VIP home page Giter VIP logo

bangla-date's Introduction

Bangla Date PHP Class

A PHP Class to convert English dates to equivalent Bangla date.

e.g: 02-03-2012 converts to ১৯ ফাল্গুন ১৪১৮

According to Bangla culture, the date changes not after 12'o clock at night, but it changes after sun rise at morning.

Class Constructor

It has 2 parameter. The first parameter is a date timestamp. If you want to change the date after 12 AM (just like English dates), you have to pass the second as 0. The default is 6.

so if you don't pass anything as 2nd parameter, the date will change at 6'o clock at morning.

Usage

Current Date

$bn_date = new BanglaDate( time() );
$date = $bn_date->get_date();

A particular Date

$bn_date = new BanglaDate( strtotime('18-03-1988') );
$date = $bn_date->get_date();

Single object, multiple convert

$bn = new BanglaDate(time());
$date = $bn->get_date();
var_dump( $date );

//another
$bn->set_time(time(), 0);
$date = $bn->get_date();
var_dump( $date );

//another
$bn->set_time(strtotime('18-03-1988'), 0);
$date = $bn->get_date();
var_dump( $date );

On PHPClasses.org

The class is also in phpclasses.org

Blog Post

Original link to the release post

bangla-date's People

Contributors

tareq1988 avatar zakirdaq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.