Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->parse()

Parse a formatted Bikram Sambat date string and update the current date instance in place.

The parse method parses a Bikram Sambat date string and updates the coordinates of the current NepaliDate instance in place. It supports various delimiter styles including slashes, dots, and hyphens, recalculating the underlying timestamp upon successful parsing.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function parse(string $dateString): void;

Parameters

ParameterTypeRequiredDescription
$dateStringstringYesFormatted Bikram Sambat date string (e.g. '2081-07-15').

Return Value

  • Type: void
  • Note: Mutates the current instance in place.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate();
$date->parse('2081-07-15');
echo $date->format('YYYY-MM-DD'); // "2081-07-15"

Advertisement

On this page