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

ActiveLibrary

rohanadhikari/nepali-date
=========================

A PHP package for handling Nepali Date and Time (Bikram Sambat - BS).

0.05(2mo ago)62081MITPHPCI passing

Since Oct 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/rohanAdhikari1/NepalIDatePHP)[ Packagist](https://packagist.org/packages/rohanadhikari/nepali-date)[ GitHub Sponsors](https://github.com/rohanadhikari1)[ RSS](/packages/rohanadhikari-nepali-date/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (6)Versions (8)Used By (1)

NepaliDate
==========

[](#nepalidate)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5f53548b4cdd5407aa1f0145484a54c6000b8994846035def154694a0e70c986/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f68616e616468696b6172692f6e6570616c692d646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rohanadhikari/nepali-date)[![Total Downloads](https://camo.githubusercontent.com/744e17f68dada4b524a00cd8cdc7d2dcf3b51e87a8be7e691bd3842ee40e2acf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f68616e616468696b6172692f6e6570616c692d646174652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rohanadhikari/nepali-date)

A PHP package for handling **Nepali Date and Time (Bikram Sambat - BS)** with full support for localization, date manipulation, and formatting. All calculations are based on the **Nepali calendar**, making it perfect for applications targeting Nepali users or systems that operate primarily in BS.

---

Note

v1-beta is optimized for fast date conversions by minimizing computational overhead. Additional optimization steps are planned. You can try v1-beta and share your feedback to help improve it.

---

🚀 Features
----------

[](#-features)

- 🕒 Works in **Nepali (BS) date and time**
- 🗓 Simple functions to **convert between AD &amp; BS**
- 🔁 Support for **mutable** and **immutable** date handling
- ➕ Add or subtract days, months, and years in BS
- 📅 Get current Nepali date and time
- 🌐 Customizable **locale** (Nepali or English)
- 🔢 Format dates in various display styles
- ⚙️ Compare, parse, and format dates easily
- 🧩 Integration-ready with Laravel and other frameworks

---

📦 Installation
--------------

[](#-installation)

Install via [Composer](https://getcomposer.org/):

```
composer require rohanadhikari/nepali-date
```

---

Usage
-----

[](#usage)

```
use RohanAdhikari\NepaliDate\NepaliDate;
use RohanAdhikari\NepaliDate\NepaliDateImmutable;

// -----------------------------
// Mutable NepaliDate
// -----------------------------
$now = NepaliDate::now(); // Current Nepali date and time

$date = NepaliDate::fromNotation('tomorrow'); // Parse a notation
$date->addDays(5);                            // Add 5 days

$adDate = $date->toAd();                       // Convert to Gregorian (AD)

$formatted = $date->format(NepaliDate::FORMAT_DATETIME_24_FULL);
// Example: 2082-06-30 14:45:22

// -----------------------------
// Immutable NepaliDate
// -----------------------------
$immutableNow = NepaliDateImmutable::now();   // Immutable current date

$immutableDate = $date->cast();               // Cast mutable to immutable and vice versa
// or
$immutableDate = $date->toImmutable();

$newDate = $immutableDate->addDays(10);       // Returns a new instance, original remains unchanged
```

Note

You can see the available constants [here](./docs/CONSTANTS.md)

Using in native PHP (no framework)
----------------------------------

[](#using-in-native-php-no-framework)

If you're not using a framework, you can still use this package in plain PHP. The easiest way is to install via Composer and include the generated autoloader.

```
// Require Composer's autoloader (adjust path as needed)
require __DIR__ . '/vendor/autoload.php';

use RohanAdhikari\NepaliDate\NepaliDate;
use RohanAdhikari\NepaliDate\NepaliDateImmutable;

// -----------------------------
// Mutable example
// -----------------------------
$now = NepaliDate::now();
echo $now->format(NepaliDate::FORMAT_DATETIME_24_FULL);

// -----------------------------
// Immutable example
// -----------------------------
$immutable = NepaliDateImmutable::now();
$new = $immutable->addDays(5); // returns a new instance
echo $new->format(NepaliDate::FORMAT_DATE_YMD);

// -----------------------------
// Create from native DateTime (AD)
// -----------------------------
$ad = new DateTime('now', new DateTimeZone('Asia/Kathmandu'));
$fromAd = NepaliDate::fromAd($ad);
echo $fromAd->format(NepaliDate::FORMAT_DATE_YMD);
```

Notes:

- Make sure the path to `vendor/autoload.php` is correct relative to your script.
- Composer is the recommended way to load the package. If you don't use Composer you need to include the package files manually (not recommended).

---

⚙️ Initialize
-------------

[](#️-initialize)

Create a new **NepaliDate** instance in different ways depending on your use case.

---

### Now

[](#now)

Returns a `NepaliDate` instance initialized with the **current Nepali date and time**.

**Parameters:**

- `timezone` *(optional)* — Defaults to `'Asia/Kathmandu'`.

**Example:**

```
use RohanAdhikari\NepaliDate\NepaliDate;

$now = NepaliDate::now();
echo $now->format(NepaliDate::FORMAT_DATETIME_12_FULL); // 2082-06-30 10:09:38 PM
//you can also specify timezone as
$now = NepaliDate::now('Asia/Kathmandu');
//or
$timezone = new DateTimeZone('Asia/Kathmandu');
NepaliDate::now($timezone);
```

---

### Using PHP Native DateTime

[](#using-php-native-datetime)

Create a `NepaliDate` instance directly from a PHP native `DateTime` (AD).
This automatically converts the **Gregorian (AD)** date into the **Nepali (BS)** calendar.

```
use RohanAdhikari\NepaliDate\NepaliDate;
$date = new DateTime();
$nepalidate = NepaliDate::fromAd($date);
echo $nepaliDate->format(NepaliDate::FORMAT_DATE_YMD); // 2082-06-30
```

---

### Using DateTime Notation

[](#using-datetime-notation)

Create a `NepaliDate` instance using a **natural language date string** (like `'now'`, `'yesterday'`, `'tomorrow'`).
This internally parses the notation using Native DateTime and converts it into a corresponding **Nepali (BS)** date.

- `notation` — A date string supported by PHP’s native `DateTime` parser (e.g., `'now'`, `'yesterday'`, `'2025-01-01'`, `'next monday'`).
- `timezone` *(optional)* — Defaults to `'Asia/Kathmandu'`.

**Example**

```
use RohanAdhikari\NepaliDate\NepaliDate;
// Create NepaliDate for tomorrow and format it
$nepaliDate = NepaliDate::fromNotation('tomorrow');

echo $nepaliDate->format(NepaliDate::FORMAT_DATE_YMD); // e.g. 2082-06-31
```

---

### Using Unix Timestamp

[](#using-unix-timestamp)

Create a `NepaliDate` instance from a **Unix timestamp**.
This method first converts the timestamp into a PHP `DateTime` object and then translates it into the equivalent **Nepali (BS)** date and time.

**Parameters**

- `timestamp` — A valid Unix timestamp (seconds since Unix epoch).
- `timezone` *(optional)* — Defaults to `'Asia/Kathmandu'`. **Example**

```
use RohanAdhikari\NepaliDate\NepaliDate;

$nepaliDate = NepaliDate::fromTimestamp(1760632252);

echo $nepaliDate->format(NepaliDate::FORMAT_DATETIME_24_FULL); // e.g. 2082-06-30 22:15:52
```

---

### Direct

[](#direct)

Manually create a new `NepaliDate` instance by providing all date components.

**Parameters**

- `year` - Nepali year (e.g. `2082`)
- `month` - Nepali month number (`1–12`)
- `day` — Day of month (`1–32`, varies by **year** and **month**)
- `hour` *(optional)* — Defaults to `0`
- `minute` *(optional)* — Defaults to `0`
- `second` *(optional)* — Defaults to `0`
- `timezone` *(optional)* — Defaults to `'Asia/Kathmandu'`.

```
use RohanAdhikari\NepaliDate\NepaliDate;

$nepalidate = new NepaliDate(2082,6,30,timezone:'Asia/kathmandu')
```

---

Format
------

[](#format)

Formats the `NepaliDate` instance according to the provided pattern and locale-specific rules, and returns a string of the formatted date. You can also use predefined fromat pattern from [Constants](./docs/CONSTANTS.md#date-formats).

**List of Available Formats Tokens**

FormatOutput ExampleMeaningY2082Yeary82Two-digit yearm2Month (1–12)n02Month, two digitsMBaiShort month nameFBaisakhFull month named09Two-digit dayj9DayDSunShort weekday namelSundayFull weekday namew1Weekday number (Sunday=1, Monday=2…)G7Hour, 24-hour clockH07Hour, 24-hour clock, 2-digitsh23Hour, 12-hour clockg12Hour, 12-hour clock, 2-digitsaam / pmMeridiem (lowercase)AAM / PMMeridiem (uppercase)i59Minute, 2-digitss59Second, 2-digitseAsia/KathmanduTimezone nameO+0530Timezone offsetP+05:45Timezone offset with colonZ20700Timezone offset in secondsc2082-02-01T14:30:00+05:45ISO 8601 datetimerSun, 01 Bai 2082 14:30:00 +0530RFC 2822 datetimeU1675289400Unix timestamp (Using Ad Date and Time)**Example:**

```
    use RohanAdhikari\NepaliDate\NepaliDate;
    // Get the current Nepali date and time
    $date = NepaliDate::now();

    // Using a predefined format (24-hour datetime)
    echo $date->format(NepaliDate::FORMAT_DATETIME_24);
    // Example output: 2082-06-31 21:14

    // Using a custom format string
    echo $date->format('Y-m-d H:i');
    // Example output: 2082-06-31 21:14

    // Using full month name + weekday
    echo $date->format('l, F j, Y');
    // Example output: Friday, Ashwin 31, 2082

    // Using ISO 8601 format
    echo $date->format('c');
    // Example output: 2082-06-31T21:14:14+05:45

    // Using RFC 2822 format
    echo $date->format('r');
    // Example output: Fri, 31 Asw 2082 21:14:14 +0545
```

---

🌐 Locale
--------

[](#-locale)

Available locales: `en` and `np`.

**Example:**

```
    use RohanAdhikari\NepaliDate\NepaliDate;

    $date = NepaliDate::now();
    $date->setLocale(NepaliDate::NEPALI); //Using defined constant
    //or
    $date->locale('np');
    //or
    $date->locale = 'np'; //Not supported for ImmmutableNepaliDate

    echo $date->format(NepaliDate::FORMAT_DATETIME_24);
    //Example Output: २०८२-०६-३१ २१:३४

    //for reset
    $date->resetLocale();
```

Note

You can also set the global default locale as:-

```
NepaliDate::defaultLocale(NepaliDate::NEPALI);
```

Any new instance of `NepaliDate` will now use this locale by default.

---

Parse
-----

[](#parse)

The `NepaliDate` class provides the `parse()` method, which allows you to create a NepaliDate instance from a string. It supports multiple default format patterns, and you can also add custom parse patterns to handle other string formats or use [`createFromFormat`](#Createfromformat).

**Default format patterns supported for parsing:**

Format Pattern`Y-m-d``Y-n-d``Y-m-d H:i:s``Y-m-d h:i:s A``h:i A``h:i:s A``H:i``H:i:s``U``c``r``D, d M Y H:i:s``l, F j, Y g:i A`**Example:**

```
    use RohanAdhikari\NepaliDate\NepaliDate;

    $nepalidate = NepaliDate::parse('2080-06-02');

    $nepalidate = NepaliDate::parse('2080-6-02');

    $nepalidate = NepaliDate::parse('13:12');

    //adding new custom parse pattern
    NepaliDate::addDefaultParserFormat('j F, Y');
    NepaliDate::parse('1 Kartik, 2082');

    //also can add multple custom parse format at once
    NepaliDate::addDefaultParserFormats(['j F, Y', 'j M, Y']);
```

---

CreateFromFormat
----------------

[](#createfromformat)

The `NepaliDate` class provides the `createFromFormat()` method, which allows you to create a NepaliDate instance from a string using a specific format.

**Example:**

```
use RohanAdhikari\NepaliDate\NepaliDate;

$nepaliDate = NepaliDate::createFromFormat('j F, Y', '1 Kartik, 2082');

$nepaliDate = NepaliDate::createFromFormat('Y-m-d H:i:s', '2080-07-01 14:30:00');

$nepaliDate = NepaliDate::createFromFormat('h:i A', '02:45 PM');
```

---

➕ Unit Operations (Add/Subtract)
--------------------------------

[](#-unit-operations-addsubtract)

**Available Methods**

UnitAdd MethodSubtract MethodYear`addYear()``subYear()`Year`addYears($n)``subYears($n)`Month`addMonth()``subMonth()`Month`addMonths($n)``subMonths($n)`Day`addDay()``subDay()`Day`addDays($n)``subDays($n)`Hour`addHour()``subHour()`Hour`addHours($n)``subHours($n)`Minute`addMinute()``subMinute()`Minute`addMinutes($n)``subMinutes($n)`Second`addSecond()``subSecond()`Second`addSeconds($n)``subSeconds($n)`**Example:**

```
use RohanAdhikari\NepaliDate\NepaliDate;

    $nepalidate = NepaliDate::now(); //Today: 2082-07-01
    $nepalidate->addYear();
    echo $nepalidate;
    //Example Output: 2083-07-01 13:48:02
    $nepalidate->subMinute();
    echo $nepalidate;
    //Example Output: 2083-07-01 13:48:15
    $nepalidate->subDays(5);
    echo $nepalidate;
    //Example Output: 2083-06-27 13:48:49
    $nepalidate->addDays(10);
    echo $nepalidate;
    //Example Output: 2083-07-07 13:50:25

    //or also you use
    $nepalidate->modifyUnit(NepaliUnit::Month, 2);
    echo $nepalidate;
    //Example Output: 2083-08-27 13:49:24
    $nepalidate->modifyUnit(NepaliUnit::Month, -3);
    echo $nepalidate;
    //Example Output: 2083-05-27 13:49:53
```

---

Dates Difference
----------------

[](#dates-difference)

Currently this difference feature is avialable for english only as it just convert date into AdDate and return builtin DateInterval instance. But feature for nepali locale will be avialble in future version. **Example:**

```
    $date1 = NepaliDate::now();
    $date2 = NepaliDate::now()->addDays(50);
    $date1->diff($date2); //will return php built in DateInterval.
```

---

🔍 Getters
---------

[](#-getters)

### 🕰️ Year / Era

[](#️-year--era)

MethodDescriptionExample`getMillennium()`Returns millennium number .`3` → for `2082``getCentury()`Returns century number .`21``getDecade()`Returns decade number .`209``getYear()`Returns full year.`2082``getShortYear()`Returns last two digits of the year.`"82"`---

### ⏰ Time (24-hour)

[](#-time-24-hour)

MethodDescriptionExample`getHour()`Hour in 24-hour format (0–23).`14``getTwoDigitHour()`Two-digit 24-hour format.`"14"``getMinute()`Minute (0–59).`45``getTwoDigitMinute()`Two-digit minute string.`"45"``getSecond()`Second (0–59).`9``getTwoDigitSecond()`Two-digit second string.`"09"`---

### 📆 Day

[](#-day)

MethodDescriptionExample`getDay()`Day of the month.`12``getTwoDigitDay()`Two-digit day string.`"12"``getWeekDay()`Day of week (1 = Sunday → 7 = Saturday).`1`---

### 📅 Month

[](#-month)

MethodDescriptionExample`getMonth()`Month number (1–12).`5``getTwoDigitMonth()`Two-digit month.`"05"``getQuarter()`Returns quarter number (1–4).`2``getDaysInMonth()`Total days in the given BS month.`32`---

### 🕛 Time (12-hour)

[](#-time-12-hour)

MethodDescriptionExample`getShortHour()`Hour in 12-hour format.`2``getTwoDigitShortHour()`Two-digit 12-hour format.`"02"``getMaridian()`Returns `"AM"` or `"PM"`.`"PM"`---

### 🌍 Timezone

[](#-timezone)

MethodDescriptionExample`getTimezone()`Returns timezone object.`DateTimeZone('Asia/Kathmandu')``getTimezoneName()`Returns timezone name.`"Asia/Kathmandu"``getTZName()`Alias for `getTimezoneName()`.`"Asia/Kathmandu"`---

### 🈯 Locale-Based

[](#-locale-based)

MethodDescriptionExample Output (Nepali)`getLocale()`Current Locale.`"np"``getLocaleMillennium()`Localized millennium number.`"३"``getLocaleCentury()`Localized century number.`"२१"``getLocaleDecade()`Localized decade number.`"२०९"``getLocaleYear()`Localized year.`"२०८२"``getLocaleShortYear()`Localized short year.`"८२"``getLocaleQuarter()`Localized quarter number.`"२"``getLocaleMonth()`Localized month number.`"५"``getLocaleTwoDigitMonth()`Localized two-digit month.`"०५"``getLocaleMonthName()`Localized month name.`"बैशाख"``getLocaleShortMonthName()`Localized short month name.`"बै"``getLocaleWeekDay()`Localized weekday number.`"१"``getLocaleWeekDayName()`Localized weekday name.`"आइतबार"``getLocaleShortWeekDayName()`Localized short weekday name.`"आइत"``getLocaleDay()`Localized day.`"१२"``getLocaleTwoDigitDay()`Localized two-digit day.`"१२"``getLocaleHour()`Localized 24-hour format.`"१४"``getLocaleShortHour()`Localized 12-hour format.`"२"``getLocaleTwoDigitShortHour()`Localized two-digit 12-hour.`"०२"``getLocaleTwoDigitHour()`Localized two-digit 24-hour.`"१४"``getLocaleMinute()`Localized minute.`"४५"``getLocaleTwoDigitMinute()`Localized two-digit minute.`"४५"``getLocaleSecond()`Localized second.`"९"``getLocaleTwoDigitSecond()`Localized two-digit second.`"०९"``getLocaleMaridian()`Localized AM/PM (currently English).`"PM"`#### Shorthand &amp; Property Access

[](#shorthand--property-access)

For any getter method, you can:

- Drop the get and lowercase the next letter → `getLocaleYear()` → `localeYear()`
- Access as property → `localeYear`**Usage:**```
     date.getLocaleYear()   // "२०८२" //for nepali locale
     date.localeYear()      // same result
     date.localeYear        // same result
    ```

**Example:**

```
```

---

⚙️ Setters
----------

[](#️-setters)

### 🔹 Basic Setters

[](#-basic-setters)

MethodDescription`setYear(int $year)`Sets the BS year.`setMonth(int $month)`Sets the BS month (1–12).`setDay(int $day)`Sets the BS day of the month.`setHour(int $hour)`Sets the hour (0–23).`setMinute(int $minute)`Sets the minute (0–59).`setSecond(int $second)`Sets the second (0–59).`setTimeZone(int|DateTimeZone|string $value)`Sets the time zone (aliases: `timeZone`, `tZone`, `tZ`).---

### 🔹 Unit-Based Setter

[](#-unit-based-setter)

MethodDescription`setUnit(string|NepaliUnit $unit, $value)`Sets a specific unit (`year`, `month`, `day`, `hour`, `minute`, `second`, `timezone`).---

### 🔹 Combined Setters

[](#-combined-setters)

MethodDescription`setDate(int $year, int $month, int $day)`Sets year, month, and day together.`setTime(int $hour, int $minute, int $second)`Sets hour, minute, and second together.---

#### Shorthand &amp; Property Assignment

[](#shorthand--property-assignment)

You can also use setter variants in two shorter forms, similar to getters:

1. Without `set` (camelCase):

    ```
    $nepalidate.year(2081);
    ```
2. As property assignment (Only Support for mutable instance).

    ```
    $nepalidate.year = 2081;
    ```

**Example:**

```
```

---

Shifting
--------

[](#shifting)

The `NepaliDate` provides methods to shift dates to their corresponding values based on different contexts like timezone or week.

### TimeZone

[](#timezone)

```
use RohanAdhikari\NepaliDate\NepaliDate;

    // current timezone: Asia/Kathmandu
    $nepaliDate = NepaliDate::now();
    echo $nepaliDate->format(NepaliDate::FORMAT_ISO_8601);
    //Exmaple Output: 2082-07-01T11:41:22+05:45

    //shift timezone to Autralia
    $nepaliDate->shiftTimezone('Australia/Melbourne');
    echo $nepaliDate->format(NepaliDate::FORMAT_ISO_8601);
    //Example Output: 2082-07-01T16:56:22+11:00
```

---

### Week

[](#week)

```
use RohanAdhikari\NepaliDate\NepaliDate;

 $nepaliDate = NepaliDate::parse('2082-07-02');
    // shift to previous monday
    $nepaliDate->shiftToNearWeek(NepaliWeekDay::Monday, false);
    echo $nepaliDate->format(NepaliDate::FORMAT_DATE_SLASH_YMD);
    // shift to next monday
    $nepaliDate->shiftToNearWeek(NepaliDate::MONDAY);
    //or
    $nepaliDate->shiftToNearWeek(NepaliWeekDay::Monday);
    echo $nepaliDate->format(NepaliDate::FORMAT_DATE_SLASH_YMD);
```

---

📏 Boundaries Methods
--------------------

[](#-boundaries-methods)

Boundary methods are used to snap a date/time to the start or end of a defined unit. This is extremely useful for:

- Rounding dates to the beginning or end of a day, week, month, or year.
- Performing date calculations for calendars.
- Filtering datasets by time ranges.

### Available Methods

[](#available-methods)

MethodDescriptionstartOfDay()Sets the time to the very beginning of the day (00:00:00).endOfDay()Sets the time to the very end of the day (23:59:59).startOfWeek($weekStart)Moves the date to the first day of the week (Sunday by default, customizable).endOfWeek($weekEnd)Moves the date to the last day of the week (Saturday by default, customizable).startOfMonth()Moves the date to the first day of the month at 00:00:00.endOfMonth()Moves the date to the last day of the month at 23:59:59.startOfQuarter()Moves the date to the first day of the current quarter at 00:00:00.endOfQuarter()Moves the date to the last day of the current quarter at 23:59:59.startOfYear()Moves the date to the first day of the year at 00:00:00.endOfYear()Moves the date to the last day of the year at 23:59:59.startOfDecade()Moves the date to the first year of the decade at 00:00:00.endOfDecade()Moves the date to the last year of the decade at 23:59:59.startOfCentury()Moves the date to the first year of the century at 00:00:00.endOfCentury()Moves the date to the last year of the century at 23:59:59.startOfMillennium()Moves the date to the first year of the millennium at 00:00:00.endOfMillennium()Moves the date to the last year of the millennium at 23:59:59.startOfHour()Sets minutes and seconds to 00:00 of the current hour.endOfHour()Sets minutes and seconds to 59:59 of the current hour.startOfMinute()Sets seconds to 00 of the current minute.endOfMinute()Sets seconds to 59 of the current minute.startOf(unit)Generic method to snap the date to the start of a specified unit (day, month, year, etc.).endOf(unit)Generic method to snap the date to the end of a specified unit (day, month, year, etc.).**Example:**

```
use RohanAdhikari\NepaliDate\NepaliDate;

$nepaliDate = NepaliDateImmutable::now();
// end of century
echo $nepaliDate->endOfCentury(); // auto convert to string using FORMAT_DATETIME_24_FULL
// Example Output: 2100-12-31 23:59:59

// start of decade
echo $nepaliDate->startOfDecade()->format(NepaliDate::FORMAT_DATE_SLASH_YMD);
// Example Output: 2080/01/01

//start of quarter
echo $nepaliDate->startOf(NepaliUnit::Quarter)->format(NepaliDate::FORMAT_DATETIME_24_FULL);
    // Example Output: 2082-07-01 00:00:00

//end of week
echo $nepaliDate->endOf(NepaliUnit::Week)->format(NepaliDate::FORMAT_DATETIME_24_FULL);
// Example Output: 2082-07-01 23:59:59
```

---

🔎 Comparison
------------

[](#-comparison)

The `NepaliDate` class provides a comprehensive set of **comparison and state-checking methods**.
These methods allow you to compare dates, check if a date falls within a range, or determine its temporal state (past, future, today, etc.).
All methods accept either another `NepaliDateInterface` instance or a date string that can be parsed into a Nepali date.

MethodAlias / ShortcutDescription`equalTo($date)``eq($date)`Returns `true` if the current date is equal to the given date.`notEqualTo($date)``ne($date)`Returns `true` if the current date is not equal to the given date.`greaterThan($date)``gt($date)`, `isAfter($date)`Returns `true` if the current date is after the given date.`greaterThanOrEqualTo($date)``gte($date)`Returns `true` if the current date is after or equal to the given date.`lessThan($date)``lt($date)`, `isBefore($date)`Returns `true` if the current date is before the given date.`lessThanOrEqualTo($date)``lte($date)`Returns `true` if the current date is before or equal to the given date.`between($date1, $date2, $equal = true)``isBetween($date1, $date2, $equal = true)`Returns `true` if the current date is between two dates (inclusive by default).`betweenIncluded($date1, $date2)`—Returns `true` if the current date is between two dates, inclusive.`betweenExcluded($date1, $date2)`—Returns `true` if the current date is between two dates, exclusive.`isWeekday()`—Returns `true` if the current date is a weekday (not Saturday).`isWeekend()`—Returns `true` if the current date is a weekend (Saturday).`isYesterday()`—Returns `true` if the current date represents yesterday.`isToday()`—Returns `true` if the current date represents today.`isTomorrow()`—Returns `true` if the current date represents tomorrow.`isFuture()`—Returns `true` if the current date is in the future.`isPast()`—Returns `true` if the current date is in the past.`isNowOrFuture()`—Returns `true` if the current date is now or in the future.`isNowOrPast()`—Returns `true` if the current date is now or in the past.**Example:**

```
use RohanAdhikari\NepaliDate\NepaliDate;

    //Today Date: 2082-07-01
    $nepaliDate = NepaliDate::parse('2082-07-02'); //WeekDay: Sunday

    var_dump($nepaliDate->eq('2082-07-02'));
    // Output: bool(true)

    var_dump($nepaliDate->gt('2082-07-02'));
    // Output: bool(false)

    var_dump($nepaliDate->gt(NepaliDate::now()));
    // Output: bool(true)

    var_dump($nepaliDate->lt(NepaliDate::now()));
    // Output: bool(false)

    var_dump($nepaliDate->between('2082-07-01', '2082-07-03'));
    // Output: bool(true)

    var_dump($nepaliDate->betweenExcluded('2082-07-01', '2082-07-02'));
    // Output: bool(false)

    var_dump($nepaliDate->betweenIncluded('2082-07-01', '2082-07-02'));
    // Output: bool(true)

    var_dump($nepaliDate->isPast());
    // Output: bool(false)

    // Check if the date is tomorrow
    var_dump($nepaliDate->isTomorrow());
    // Output: bool(true)

    // Check if the date is weekday
    var_dump($nepaliDate->isWeekday());
    // Output: bool(true)

    // Check if the date is weekend
    var_dump($nepaliDate->subDays(1)->isWeekend());
    // Output: bool(true)
```

---

Additional
----------

[](#additional)

### Usage in Laravel Example

[](#usage-in-laravel-example)

For detailed instructions on using **NepaliDate** in a Laravel application, see the [Laravel Integration Guide](./docs/LARAVEL.md).

---

### 🌐 Locale Customization

[](#-locale-customization)

You can customize locale data for months, weekdays, numbers, and more.
For detailed instructions, see the [LocaleCustomize](./docs/LOCALECUSTOMIZE.md) documentation.

---

### ⚡ Custom Functions / Macros

[](#-custom-functions--macros)

You can also add your own functions or macros to extend `NepaliDateTime` functionality.
For detailed instructions, see the [Macro](./docs/MACRO.md) documentation.

---

### NepaliNumbers

[](#nepalinumbers)

You can also use the `NepaliNumbers` class to work with Nepali numerals. For detailed information, see the [NepaliNumbers](./docs/NEPALINUMBERS.md) documentation.

---

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance86

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

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

Recently: every ~34 days

Total

6

Last Release

67d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/722e0f070daa642c9e8674712aa1dbefba22a6de0d27745f9fa9d1497b59ea29?d=identicon)[rohan123](/maintainers/rohan123)

---

Top Contributors

[![rohanAdhikari1](https://avatars.githubusercontent.com/u/82314325?v=4)](https://github.com/rohanAdhikari1 "rohanAdhikari1 (52 commits)")

---

Tags

nepalinepali-calendarnepali-datenepali-date-conversionnepali-date-phpnepali-date-timenepali-datesnepali-timenepali-timezonephp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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