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
Installation
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';
Usage
Usage examples:
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.
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?
Kind Regards,
Kamal
Thank you!!
I’ve always found working with Nepali dates a bit tricky, so this Composer package is a welcome solution. The ability to seamlessly convert and manipulate Nepali dates within PHP applications is going to save a lot of time and effort. Kudos to the developers for creating this handy utility!
I’m unable to convert 2080-09-30. how to convert?
`2080-09-30` is not valid. There were only 29 days in that month in 2080.
hello sir, there is only 31 days in jestha month of 2081 in nepali date picker. How to update this data ? As there is 32 days in jestha month of 2081.
I have updated the package today. Can you please update and check if issue has been fixed?
Please give me a solution. I could’t not get soltion even I researched a lot
What is the range of date that this can handle?
It supports 2000 – 2090 BS.