PHP

Nepali Date: PHP Composer Package for Nepali Date Converter and Utilities

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.

13 thoughts on “Nepali Date: PHP Composer Package for Nepali Date Converter and Utilities

  1. 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!

  2. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *