Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->addDays()

Add or subtract a specified number of days to a NepaliDate instance with automatic month and year rollover.

The addDays method modifies the current NepaliDate instance by adding or subtracting a given integer number of days. It automatically handles variable Bikram Sambat month day counts, transitions across month boundaries, and advances or decrements the year when needed.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function addDays(int $days): self;

Parameters

ParameterTypeRequiredDescription
$daysintYesPositive or negative number of days to add.

Return Value

  • Type: NepaliDate
  • Description: Returns $this after mutating internal coordinates.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate('2081-01-25');
$date->addDays(10);
echo $date->format('YYYY-MM-DD'); // Transitions into Jestha

Advertisement

On this page