Methods
date->isAfter()
Check whether the current date occurs chronologically after another specified date.
The isAfter method evaluates whether the current NepaliDate instance occurs chronologically later than another date or timestamp. It compares exact millisecond values to determine chronological order accurately.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function isAfter(NepaliDate $date): bool;Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
$date | NepaliDate | Yes | Target date to compare against. |
Return Value
- Type:
bool - Description: Returns
trueif current date is chronologically later than$date.
Example
use NepaliDateLibrary\NepaliDate;
$d1 = new NepaliDate('2081-01-15');
$d2 = new NepaliDate('2081-01-01');
var_dump($d1->isAfter($d2)); // trueRelated
date->isBefore(): Check if earlier in time.date->isEqual(): Check calendar date equality.
Advertisement
date->isBefore()
Check whether the current date occurs chronologically before another specified date.
date->isEqual()
Check whether two date instances share the exact same calendar date coordinates regardless of time.