Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->isEqual()

Check whether two date instances share the exact same calendar date coordinates regardless of time.

The isEqual method checks whether the current NepaliDate instance shares the exact same Bikram Sambat year, month, and day coordinates as another date object, ignoring any differences in hours, minutes, seconds, or milliseconds.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function isEqual(NepaliDate $date): bool;

Parameters

ParameterTypeRequiredDescription
$dateNepaliDateYesDate instance to compare coordinates with.

Return Value

  • Type: bool
  • Description: Returns true if year, month, and day are identical.

Example

use NepaliDateLibrary\NepaliDate;

$d1 = new NepaliDate('2081-07-15');
$d2 = new NepaliDate('2081-07-15');

var_dump($d1->isEqual($d2)); // true

Advertisement

On this page