sagartimilsina/nepali-date

Convert dates between Bikram Sambat (BS) and Gregorian (AD), with English and Nepali (Devanagari) input support, for PHP and Laravel.

Maintainers

Package info

github.com/timilsinasagar/Nepali-Date-Converter-Package

pkg:composer/sagartimilsina/nepali-date

Transparency log

Statistics

Installs: 6

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-08 06:16 UTC
No longer found in upstream repository

This package is auto-updated.

Last update: 2026-07-08 06:59:38 UTC


README

Latest Version PHP Version License

A lightweight, accurate, and developer-friendly PHP package for converting dates between Bikram Sambat (BS) and Gregorian (AD).

Supports both Laravel and plain PHP applications.

Features

  • ✅ Convert BS → AD
  • ✅ Convert AD → BS
  • ✅ Accepts English and Nepali (Devanagari) numerals
  • ✅ Format dates in English or Nepali
  • ✅ Day of week support
  • ✅ Month name support
  • ✅ Laravel Auto Discovery
  • ✅ Zero external API dependency
  • ✅ Fast and lightweight
  • ✅ PHP 8.2+

Requirements

  • PHP 8.2+
  • Laravel 9, 10, 11, 12, 13 (optional)

Installation

Install via Composer.

composer require sagartimilsina/nepali-date

Laravel will automatically discover the service provider.

Basic Usage

use Sagartimilsina\NepaliDate\Facades\NepaliDate;

BS to AD

$result = NepaliDate::bsToAd('2083-03-24');

echo $result;

Output

2026-07-08

AD to BS

$result = NepaliDate::adToBs('2026-07-08');

echo $result;

Output

2083-03-24

Nepali Number Input

The package accepts Nepali digits.

NepaliDate::bsToAd('२०८३-०३-२४');

Nepali Output

NepaliDate::adToBs(
    '2026-07-08',
    language: 'np'
);

Output

२०८३-०३-२४

Get Month Name

NepaliDate::monthName(3);

Output

Ashadh

Nepali

NepaliDate::monthName(3, 'np');

Output

असार

Get Day Name

NepaliDate::dayName('2026-07-08');

Output

Wednesday

Nepali

NepaliDate::dayName('2026-07-08', 'np');

Output

बुधबार

Format Date

NepaliDate::format(
    '2083-03-24',
    language: 'en'
);

Output

24 Ashadh 2083

Nepali

NepaliDate::format(
    '2083-03-24',
    language: 'np'
);

Output

२४ असार २०८३

Plain PHP Usage

require 'vendor/autoload.php';

use Sagartimilsina\NepaliDate\NepaliDate;

$date = new NepaliDate();

echo $date->bsToAd('2083-03-24');

Supported Years

Calendar Supported Years
BS 2000 – 2100
AD 1943 – 2044

Example

use Sagartimilsina\NepaliDate\Facades\NepaliDate;

echo NepaliDate::adToBs('2026-07-08');

echo NepaliDate::bsToAd('2083-03-24');

Testing

composer test

or

vendor/bin/phpunit

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push the branch
  5. Open a Pull Request

Roadmap

  • BS → AD Conversion
  • AD → BS Conversion
  • Nepali Number Support
  • Laravel Integration
  • Carbon Integration
  • Date Validation Helpers
  • Blade Components
  • Localization Improvements

License

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

Author

Sagar Timilsina

Laravel & Full Stack Developer

GitHub

https://github.com/timilsinasagar

Packagist

https://packagist.org/packages/sagartimilsina/nepali-date

If this package helps you, please consider giving it a ⭐ on GitHub.