PHPackages                             ernilambar/nepali-date - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ernilambar/nepali-date

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ernilambar/nepali-date
======================

Nepali (Bikram Sambat) calendar utilities and BS ↔ AD date conversion for PHP.

1.0.9(2mo ago)512.8k↑189.3%4[1 issues](https://github.com/ernilambar/nepali-date/issues)MITPHPPHP &gt;=5.6CI passing

Since Jun 9Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/ernilambar/nepali-date)[ Packagist](https://packagist.org/packages/ernilambar/nepali-date)[ Docs](https://github.com/ernilambar/nepali-date)[ RSS](/packages/ernilambar-nepali-date/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (12)Used By (0)

Nepali Date
===========

[](#nepali-date)

[![Stable Version](https://camo.githubusercontent.com/ed7e232b724d06b1f95d3bddde60b924fdeee224b1867b098c45f193cda95d49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f65726e696c616d6261722f6e6570616c692d646174653f6c6162656c3d537461626c6526636f6c6f723d333239464434)](https://packagist.org/packages/ernilambar/nepali-date)[![Type: Library](https://camo.githubusercontent.com/3185153a66223d0c8f35358587cbf5f52aeed4d5ab4793a8e8d091e95d8a8cac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547970652d4c6962726172792d627269676874677265656e2e737667)](https://packagist.org/packages/ernilambar/nepali-date)[![PHP Version](https://camo.githubusercontent.com/ffc2bfabb5ffbb477c2d24bfc90472954366e0dd5fac3eabaf4b8bfb5f8a779f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f65726e696c616d6261722f6e6570616c692d646174652f706870)](https://packagist.org/packages/ernilambar/nepali-date)[![License](https://camo.githubusercontent.com/992059607f6e7805ef9c260ad4da32fc0169c5e8879306c02ef4b260644182ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f65726e696c616d6261722f6e6570616c692d646174653f6c6162656c3d4c6963656e7365)](https://github.com/ernilambar/nepali-date/blob/master/LICENSE)

**Nepali (Bikram Sambat) calendar utilities and BS ↔ AD (Gregorian) date conversion for PHP.** This package converts between BS and AD dates and exposes helpers for formatted labels (English or Nepali script).

Requirements
------------

[](#requirements)

- PHP 5.6+.
- [Composer](https://getcomposer.org/) for managing PHP dependencies.

Installation
------------

[](#installation)

Install the package with Composer (see [Packagist](https://packagist.org/packages/ernilambar/nepali-date)):

```
composer require ernilambar/nepali-date
```

### Autoloading

[](#autoloading)

Require Composer’s autoload once from your project root (where `vendor/` lives).

```
require_once __DIR__ . '/vendor/autoload.php';
```

Usage
-----

[](#usage)

Examples use **integers** for year, month, and day. The API also accepts **numeric strings** (e.g. `'2077'`) where values are used numerically.

```
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);

// Date details for a BS date (language: 'en' or 'np' for Devanagari numerals / labels).
$date = $obj->getDetails(2077, 1, 1, 'bs', 'en');
$date = $obj->getDetails(2077, 1, 1, 'bs', 'np');

// Date details for an AD date (converted internally, then formatted like BS).
$date = $obj->getDetails(2020, 1, 1, 'ad', 'en');
```

`getDetails( $year, $month, $day, $type, $language )`: `$type` is `'bs'` or `'ad'`; `$language` is optional and defaults to `'en'`.

Supported ranges
----------------

[](#supported-ranges)

Conversions rely on a **fixed embedded calendar table**. In practice:

- **Gregorian (AD):** years **1944–2033** are considered by the range checks; only dates that exist in the table can be converted (the first supported pair is **1944-01-01** ↔ **BS 2000-09-17**, and the last supported AD day in the current data is **2033-04-13** ↔ **BS 2089-12-30**).
- **Bikram Sambat (BS):** years **2000–2089** are in range; individual month/day combinations must still exist in the table (invalid or out-of-range inputs typically yield an **empty array** from conversion methods).

Copyright and License
---------------------

[](#copyright-and-license)

This project is licensed under the [MIT](http://opensource.org/licenses/MIT).

2026 © [Nilambar Sharma](https://www.nilambar.net).

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance82

Actively maintained with recent releases

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~238 days

Recently: every ~435 days

Total

10

Last Release

67d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2098823?v=4)[Nilambar Sharma](/maintainers/ernilambar)[@ernilambar](https://github.com/ernilambar)

---

Top Contributors

[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (45 commits)")[![bikash-izaki](https://avatars.githubusercontent.com/u/125429359?v=4)](https://github.com/bikash-izaki "bikash-izaki (2 commits)")

---

Tags

conversionconverterdatecalendaradgregoriannepalidate-converterbikram-sambatBSNepali Calendar

### Embed Badge

![Health badge](/badges/ernilambar-nepali-date/health.svg)

```
[![Health](https://phpackages.com/badges/ernilambar-nepali-date/health.svg)](https://phpackages.com/packages/ernilambar-nepali-date)
```

###  Alternatives

[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[aeon-php/calendar

PHP type safe, immutable calendar library

20810.4M16](/packages/aeon-php-calendar)[yohang/calendr

Object Oriented calendar management

474621.5k3](/packages/yohang-calendr)[umulmrum/holiday

A PHP library to compute holidays. It's something :-)

93385.8k1](/packages/umulmrum-holiday)[fisharebest/ext-calendar

Implementation of the Arabic (Hijri), French, Gregorian, Jewish, Julian and Persian (Jalali) calendars. Also provides a replacement for the PHP ext/calendar extension.

36513.6k11](/packages/fisharebest-ext-calendar)[mohamedsabil83/laravel-hijrian

Hijri-Gregorian date converter for Laravel

1322.4k](/packages/mohamedsabil83-laravel-hijrian)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
