PHPackages                             mr.incognito/date-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. mr.incognito/date-converter

ActiveLaravel-package[Utility &amp; Helpers](/categories/utility)

mr.incognito/date-converter
===========================

The laravel package for converting AD date to BS Date and vice versa

v1.1.0(11mo ago)09MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI passing

Since Mar 12Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/SandeepX/date-converter)[ Packagist](https://packagist.org/packages/mr.incognito/date-converter)[ RSS](/packages/mrincognito-date-converter/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (8)Used By (0)

Laravel Date Convertor
======================

[](#laravel-date-convertor)

A Laravel package to easily convert dates between AD (Anno Domini) and BS (Bikram Sambat) calendars. The package provides a simple interface for converting dates from the Gregorian (AD) calendar to the Nepali (BS) calendar and vice versa.

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

[](#installation)

Follow the steps below to install the `mr.incognito/date-converter` package into your Laravel application.

### 1. Install via Composer

[](#1-install-via-composer)

Run the following command to add the package to your Laravel project:

```
  composer require mr.incognito/date-converter
```

Usage
-----

[](#usage)

Once the package is installed, you can easily convert AD to BS and BS to AD in your application.

```
$engDate = '2025-03-12';

$npDate = '2081-11-28';

$currentBsDate = DateConverter::currentBsDate('m-d-Y');;
// Result: '11-28-2081'

$currentBsDateDetailInArray = DateConverter::currentBsDateDetail();
// Result: [  "year" => 2081
              "month" => 11
              "day" => 28
              "week_day" => "बुधवार"
              "month_name" => "फाल्गुण"
              "num_week_day" => 4 ]

$currentAdDate = DateConverter::currentAdDate('m/d/Y');;
// Result: '03/12/2025'

$currentAdDateDetailInArray = DateConverter::currentAdDateDetail();
// Result: [  "year" => 2025
              "month" => 3
              "day" => 12
              "week_day" => "Wednesday"
              "month_name" => "Mar"
              "num_week_day" => 3 ]

$dateFromAdTBS = DateConverter::fromAdToBs('2025-3-12', 'm/d/Y');
// Result: '11/28/2081'

$dateFromBsToAd = DateConverter::fromBsToAd('2081-11-28', 'm-d-Y');
// Result: '03-12-2025'

// month can be NepaliMonthEnum::XXX->value or month number (1-12)

$totalDaysInNepaliMonth = DateConverter::totalDaysInNepaliMonth(2081, NepaliMonthEnum::FALGUN->value);
// Result: 29

$startAndEndAdDateFromNepaliYear = DateConverter::startAndEndAdDateFromNepaliYear(2081, 'm-d-Y');
// Result: [
  "start_date" => "04-13-2024"
  "end_date" => "04-13-2025"
]

$startAndEndAdDateFromNepaliMonth = DateConverter::startAndEndAdDateFromNepaliMonth(2081, NepaliMonthEnum::FALGUN->value,'m-d-Y');
// Result: [
  "start_date" => "02-13-2025"
  "end_date" => "03-13-2025"
]

$totalDaysInBsYear = DateConverter::daysInBsYear(2080);
// Result: 365

$totalDaysInADYear = DateConverter::daysInAdYear(2024);
// Result: 366
```

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

[](#format-specifiers)

The following format specifiers are supported for formatting dates:

- `Y` - Year in four digits
- `m` - Month in two digits with leading zero (01-12)
- `d` - Day in two digits with leading zero (01-31)

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [SandeepPant](https://github.com/sandeepx)
- [All Contributors](../../contributors)

License
-------

[](#license)

This package is open-sourced software licensed under the MIT license.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance50

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~20 days

Recently: every ~29 days

Total

7

Last Release

355d ago

PHP version history (3 changes)v1.0.0PHP &gt;=8.0

v1.0.2PHP ^8.0 || ^8.1 || ^8.2

v1.0.5PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47293893?v=4)[Sandeep pant](/maintainers/SandeepX)[@SandeepX](https://github.com/SandeepX)

---

Top Contributors

[![SandeepX](https://avatars.githubusercontent.com/u/47293893?v=4)](https://github.com/SandeepX "SandeepX (26 commits)")

---

Tags

phplaravelpackagelaravel-packagebackendnepali-datedate-converterlaravel-toolkitdeveloper tooldeveloper-helperenglish date

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mrincognito-date-converter/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[erag/laravel-pwa

A simple and easy-to-use PWA (Progressive Web App) package for Laravel applications.

180124.1k](/packages/erag-laravel-pwa)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7213.0k](/packages/tehwave-laravel-achievements)[tehwave/laravel-shortcodes

Simple, elegant WordPress-like Shortcodes the Laravel way

1281.2k](/packages/tehwave-laravel-shortcodes)[waad/laravel-profanity-filter

Laravel Profanity Filter - Powerful PHP package for detecting, filtering, and masking profanity in multiple languages. Supports leet speak, custom word lists, case sensitivity, and seamless Laravel integration.

206.9k](/packages/waad-laravel-profanity-filter)

PHPackages © 2026

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