Nepali Date is a PHP composer package for Nepali to English Date converter. In Nepal, Bikram Sambat (BS) date is used and we frequently need to convert BS date to AD date. This package provides helper class and methods for the purpose. Instructions for installation and usages examples are given below.
Github Link: Github
Use Composer to install the package. If you have not setup Composer in your machine, please visit Get Composer first.
composer require ernilambar/nepali-date
Use following to include autoload file in your project.
require_once __DIR__ . '/vendor/autoload.php';
use Nilambar\NepaliDate\NepaliDate; $obj = new NepaliDate(); // Convert BS to AD. $date = $obj->convertBsToAd('2077', '1', '1'); // Convert AD to BS. $date = $obj->convertAdToBs('2020', '1', '1'); // Get Nepali date details by BS date. $date = $obj->getDetails('2077', '1', '1', 'bs'); // Get Nepali date details by AD date. $date = $obj->getDetails('2020', '1', '1', 'ad');
If you have any queries or feedback or if you find bug, please feel free to create issue in the GitHub repo.
5 thoughts on “Nepali Date: PHP Composer Package for Nepali Date Converter and Utilities”
Thank you a lot sir
Thanks a lot. I needed this for a project.
Thank you so much, sir! This is very helpful for my projects.
Hello Nilambar JI,
Can we use this in Laravel 8, laravel 8 application as module?