PHPackages                             akashpoudelnp/nepali-date-carbon - 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. akashpoudelnp/nepali-date-carbon

ActiveLibrary

akashpoudelnp/nepali-date-carbon
================================

This package will extend the carbon to support for nepali date

v0.2.0(11mo ago)230↓100%MITPHPPHP ^8.2CI passing

Since Feb 19Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/akashpoudelnp/nepali-date-carbon)[ Packagist](https://packagist.org/packages/akashpoudelnp/nepali-date-carbon)[ RSS](/packages/akashpoudelnp-nepali-date-carbon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

 [![Aakash Logo](https://camo.githubusercontent.com/7e151a59e5bcbab1b2ffd2e855395906adb754c61279020a0ef8e73ba94781a2/68747470733a2f2f616b617368706f7564656c2e636f6d2e6e702f6e616d652e737667)](https://camo.githubusercontent.com/7e151a59e5bcbab1b2ffd2e855395906adb754c61279020a0ef8e73ba94781a2/68747470733a2f2f616b617368706f7564656c2e636f6d2e6e702f6e616d652e737667)

Nepali Date for Carbon
======================

[](#nepali-date-for-carbon)

 [![Latest Version](https://camo.githubusercontent.com/6d08faa98c9022a5c32971ce53b24191d0b36b95930b7202a508efb0f1db7b95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616b617368706f7564656c6e702f6e6570616c692d646174652d636172626f6e)](https://packagist.org/packages/akashpoudelnp/nepali-date-carbon) [![Build Status](https://github.com/akashpoudelnp/nepali-date-carbon/workflows/tests/badge.svg)](https://github.com/akashpoudelnp/nepali-date-carbon/actions) [![Total Downloads](https://camo.githubusercontent.com/1815a6537e913fb8f7048d406b169e2a4db524b85ceba730a7272d6e57bcd359/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b617368706f7564656c6e702f6e6570616c692d646174652d636172626f6e)](https://packagist.org/packages/akashpoudelnp/nepali-date-carbon) [![License](https://camo.githubusercontent.com/1753a3d094ea039e0db79b5dbae3bf235facc505ee82b23d90e839b6031e21cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616b617368706f7564656c6e702f6e6570616c692d646174652d636172626f6e)](https://github.com/akashpoudelnp/nepali-date-carbon/blob/master/LICENSE.md)

Introduction
------------

[](#introduction)

This is a powerful package that extends Laravel's Carbon to support Nepali (Bikram Sambat) dates. It provides an elegant way to convert between Gregorian (AD) and Nepali (BS) calendar systems, format dates in Nepali, and display dates in Nepali language.

Features
--------

[](#features)

- 🔄 Seamless conversion between AD and BS dates
- 🔢 Support for Nepali date formats
- 🇳🇵 Nepali language translation for dates
- 🧩 Extends Carbon - use all existing Carbon functionality
- ⚡ Easy to use with Laravel's existing date handling

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

[](#requirements)

- PHP 8.2+
- Laravel 12+

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

[](#installation)

Install the package via Composer:

```
composer require akashpoudelnp/nepali-date-carbon
```

Documentation
-------------

[](#documentation)

### Basic Usage

[](#basic-usage)

#### Converting AD to BS

[](#converting-ad-to-bs)

You can convert any Carbon instance to a Nepali Date:

```
use Carbon\Carbon;

// Convert current date to BS
$nepaliDate = now()->convertToBS();
echo $nepaliDate->format('Y-m-d'); // "2080-12-15"

// Convert a specific date to BS
$date = Carbon::parse('2023-05-15');
$nepaliDate = $date->convertToBS();
echo $nepaliDate->format('Y F d'); // "2080 Jestha 01"
```

#### Converting BS to AD

[](#converting-bs-to-ad)

You can also convert a Nepali Date back to a Gregorian Date:

```
use Carbon\Carbon;

// Convert current BS date to AD
$gregorianDate = now()->createFromBS($year, $month, $day);
echo $gregorianDate->format('Y-m-d'); // "2023-05-15"
```

#### Formatting Nepali Dates

[](#formatting-nepali-dates)

You can format Nepali dates using the `format` method:

```
$nepaliDate = now()->convertToBS();
echo $nepaliDate->format('Y F d'); // "2080 Jestha 01"
echo $nepaliDate->format('l, F j, Y'); // "Saturday, Jestha 01, 2080"
```

### Date Formatting

[](#date-formatting)

The format method supports standard Carbon date formatting options, but with Nepali date formats. Here are some common format characters you can use:

- `Y`: Year (4 digits)
- `F`: Full month name
- `d`: Day of the month (2 digits)
- `l`: Full name of the day of the week
- `j`: Day of the month without leading zeros
- `D`: Short day name
- `m`: Month number (2 digits)
- `n`: Month number without leading zeros
- `g`: Hour in 12-hour format without leading zeros
- `G`: Hour in 24-hour format without leading zeros
- `h`: Hour in 12-hour format with leading zeros
- `H`: Hour in 24-hour format with leading zeros
- `i`: Minutes with leading zeros
- `s`: Seconds with leading zeros

### Localization

[](#localization)

The package supports Nepali language localization. You can pass the `$isNepali` parameter to the `format` method or `convertToBS`to get the date in Nepali language:

```
$nepaliDate = now()->convertToBS(
    format: 'Y-m-d',
    inNepali: true // Or use can use app()->isLocale('ne') to check if the app locale is Nepali
);
echo $nepaliDate; // "२०८०-१२-१५"
```

### Testing

[](#testing)

To run the tests, use the following command:

```
composer test
```

Contributing
------------

[](#contributing)

We welcome contributions to this package! Please read our [contributing guidelines](https://github.com/akashpoudelnp/nepali-date-carbon/blob/master/CONTRIBUTING.md) for details on how to get started.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/license/mit/).

Credits
-------

[](#credits)

- [Aakash Poudel](https://akashpoudel.com.np) - Package Author
- [Laravel](https://laravel.com) - The framework this package extends
- [Carbon](https://carbon.nesbot.com) - The date library this package extends
- [Contributors](https://github.com/akashpoudelnp/nepali-date-carbon/graphs/contributors) - All the amazing people who have contributed to this project

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~412 days

Total

3

Last Release

352d ago

PHP version history (2 changes)0.1PHP ^8.1

v0.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/bbc636a7261c312bbe2ca5fc35677afa81a05829cc60d5b6aec80360b4ddcf6d?d=identicon)[akashpoudelnp](/maintainers/akashpoudelnp)

---

Top Contributors

[![akashpoudelnp](https://avatars.githubusercontent.com/u/35787929?v=4)](https://github.com/akashpoudelnp "akashpoudelnp (15 commits)")

---

Tags

nepali-datelaravel-nepali-datebs-to-adad-to-bsAakash Poudel

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[anuzpandey/laravel-nepali-date

A Laravel Package to convert English Date (A.D.) to Nepali Date (B.S.) and vice-versa.

1615.5k](/packages/anuzpandey-laravel-nepali-date)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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