PHPackages                             krbaidik/laravel-ad-bs-converter - 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. krbaidik/laravel-ad-bs-converter

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

krbaidik/laravel-ad-bs-converter
================================

A Laravel package to convert AD dates to BS and vice versa.

v1.0.2(1y ago)173MITPHPPHP ^7.3|^8.1

Since May 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/krbaidik/laravel-ad-bs-converter)[ Packagist](https://packagist.org/packages/krbaidik/laravel-ad-bs-converter)[ RSS](/packages/krbaidik-laravel-ad-bs-converter/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

Laravel Nepali Date Converter
=============================

[](#laravel-nepali-date-converter)

[![Latest Version](https://camo.githubusercontent.com/94fb0b4f0ec617c41af799c3370ce032670c073374a1f2d00171a4b125116bc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b7262616964696b2f6c61726176656c2d61642d62732d636f6e7665727465722e737667)](https://packagist.org/packages/krbaidik/laravel-ad-bs-converter)[![License](https://camo.githubusercontent.com/09b357eb3e8187c512202f69a8c6e3f0f697dfb064d2851cfbd9eb93f130b610/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b7262616964696b2f6c61726176656c2d61642d62732d636f6e7665727465722e737667)](LICENSE.md)

A complete Nepali (Bikram Sambat) to English (Gregorian) date conversion package for Laravel with advanced features.

Features
--------

[](#features)

- **Bi-directional Conversion**: Convert between BS and AD dates
- **Carbon Integration**: Seamless interoperability with Carbon
- **Localization**: Support for Nepali and English output
- **Fiscal Year Calculation**: Nepali fiscal year support
- **Database Ready**: Eloquent cast support
- **Macroable**: Extend functionality easily
- **Weekend Detection**: Identify weekends in Nepali calendar

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

[](#installation)

You can install the package via composer:

```
composer require krbaidik/laravel-ad-bs-converter
```

Optionally, you can publish the config file with:

```
php artisan vendor:publish --tag="nepali-date-config"
```

Basic Usage
===========

[](#basic-usage)

```
use Krbaidik\AdBsConverter\Facades\NepaliDate;

// English to Nepali
$nepaliDate = NepaliDate::createFromEng(2023, 5, 15);
echo $nepaliDate->format('Y-m-d'); // २०८०-०२-०१

// Nepali to English
$englishDate = NepaliDate::createFromNep(2080, 2, 1)->toCarbon();

//Current Date
$today = NepaliDate::today()->format('Y F d, D');
// २०८० भाद्र १५, सोमबार

//Formatting Options
$date = NepaliDate::parse('2080-09-15');

// Default format
$date->format('Y-m-d'); // २०८०-०९-१५

// English digits
$date->format('Y-m-d', englishDigits: true); // 2080-09-15

//Fiscal Year Calculation
NepaliDate::today()->fiscalYear(); // "2080/81"
NepaliDate::today()->fiscalYearNepali(); // "२०८०/८१"

//Database Integration
// In your model
protected $casts = [
    'event_date' => \Krbaidik\AdBsConverter\Casts\NepaliDateCast::class
];

// Automatic conversion
$event = Event::create([
    'event_date' => '2080-09-15' // Stored as string, retrieved as NepaliDate object
]);

//Weekend Detection
NepaliDate::today()->isWeekend(); // true | false

// Total days in a month of a year
NepaliDate::getDaysInMonth(2082,1); // 31

// New year detection
NepaliDate::today()->isNewYear(); // true | false

$date1 = NepaliDate::parse('2080-01-01');
$date2 = NepaliDate::parse('2080-09-15');

// Difference in days
$date1->diffInDays($date2);

$date = NepaliDate::parse('2080-01-01');

// Add 15 days
$futureDate = $date->addDays(15);
$futureDate->format('Y-m-d'); // २०८०-०१-१६

// Nepali (default)
NepaliDate::today()->format('F'); // "भाद्र"

// English
NepaliDate::today()->setLocale('en')->format('F'); // "Bhadra"
```

API Reference
-------------

[](#api-reference)

Main Methods

- `today()` - Get today's date in BS
- `now()` - Alias for today()
- `createFromEng()` - Create from English date
- `createFromNep()` - Create from Nepali date
- `parse()` - Parse date string
- `fromCarbon()` - Create from Carbon instance
- `getDaysInMonth()`- Get total days in a month os a year

Instance Methods

- `format()` - Format the date
- `toCarbon()` - Convert to Carbon instance
- `isWeekend()` - Check if weekend
- `fiscalYear()` - Get fiscal year
- `fiscalYearNepali()` - Get fiscal year in nepali
- `setLocale()` - Change output locale
- `getLocale()` - Get current locale
- `isNewYear()` - Check if new year
- `diffInDays()` - Get day difference in two dates
- `...`

Format Specifiers
-----------------

[](#format-specifiers)

The following format specifiers are supported for formatting dates:

- `Y` - Year in four digits
- `y` - Year in two digits
- `m` - Month in two digits with leading zero (01-12/०१-१२)
- `n` - Month in one or two digits without leading zero (1-12/१-१२)
- `F` - Month in full name (January-December/बैशाख-चैत्र)
- `d` - Day in two digits with leading zero (01-31/०१-३२)
- `j` - Day in one or two digits without leading zero (1-31/१-३२)
- `D` - Day in full name (Sunday-Saturday/आइतबार-शनिबार)
- `S` - Day in two letters (st, nd, rd, th)

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Khubi Ram Baidik](https://github.com/krbaidik)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance46

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

3

Last Release

413d ago

### Community

Maintainers

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

---

Top Contributors

[![khubiallstar](https://avatars.githubusercontent.com/u/120708666?v=4)](https://github.com/khubiallstar "khubiallstar (4 commits)")[![krbaidik](https://avatars.githubusercontent.com/u/38291963?v=4)](https://github.com/krbaidik "krbaidik (1 commits)")

### Embed Badge

![Health badge](/badges/krbaidik-laravel-ad-bs-converter/health.svg)

```
[![Health](https://phpackages.com/badges/krbaidik-laravel-ad-bs-converter/health.svg)](https://phpackages.com/packages/krbaidik-laravel-ad-bs-converter)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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