Nepali DateNepali DateBikram Sambat Date Engine
Methods

Packagistdate->endOfMonth()

Return a new NepaliDate instance set to the final day of the current Bikram Sambat month.

The endOfMonth method returns a new NepaliDate instance positioned on the last valid calendar day of the active month. It automatically checks the calendar map to determine whether the month ends on day 29, 30, 31, or 32, which is useful for monthly reporting and billing cycles.


Import

use NepaliDateLibrary\NepaliDate;

Signature

public function endOfMonth(): self;

Parameters

  • None.

Return Value

  • Type: NepaliDate
  • Description: New date instance on the final day of the current month.

Example

use NepaliDateLibrary\NepaliDate;

$date = new NepaliDate('2081-01-10');
$lastDay = $date->endOfMonth();
echo $lastDay->format('YYYY-MM-DD'); // Day 31 for Baisakh 2081

Advertisement

On this page