Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->isValidInstance()

Validate whether the current NepaliDate instance represents a legitimate calendar date within supported bounds.

The isValidInstance method checks whether the current NepaliDate instance contains valid calendar values and falls within the supported range of 1976 through 2100 BS. It verifies that year, month, and day coordinates correspond to an authentic historical date.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function isValidInstance(): bool;

Parameters

  • None.

Return Value

  • Type: bool
  • Description: Returns true if the date is valid.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate('2081-07-15');
var_dump($date->isValidInstance()); // true

Advertisement

On this page