Methods
date->startOfMonth()
Return a new NepaliDate instance set to the first day of the current Bikram Sambat month.
The startOfMonth method returns a new NepaliDate instance positioned on day 1 of the active Bikram Sambat month with time set to midnight. It is commonly used for monthly calendar views, statements, and aggregation buckets.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function startOfMonth(): self;Parameters
- None.
Return Value
- Type:
NepaliDate - Description: New date instance on day 1 of the month.
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-07-15');
$firstDay = $date->startOfMonth();
echo $firstDay->format('YYYY-MM-DD'); // "2081-07-01"Related
date->endOfMonth(): Final day of the month.date->startOfYear(): First day of the year.
Advertisement
date->endOfWeek()
Return a new NepaliDate instance set to the final day of the current week on Saturday.
date->endOfMonth()
Return a new NepaliDate instance set to the final day of the current Bikram Sambat month.