Methods
date->startOfYear()
Return a new NepaliDate instance set to the first day of the Bikram Sambat year on 1 Baisakh.
The startOfYear method returns a new NepaliDate instance set to 1 Baisakh, the first day of the Bikram Sambat calendar year. This is useful for year to date financial tracking and annual summary reports.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function startOfYear(): self;Parameters
- None.
Return Value
- Type:
NepaliDate - Description: New date instance positioned on 1 Baisakh of the current year.
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-07-15');
$yearStart = $date->startOfYear();
echo $yearStart->format('YYYY-MM-DD'); // "2081-01-01"Related
date->endOfYear(): Final day of the year.date->startOfMonth(): First day of the month.
Advertisement
date->endOfMonth()
Return a new NepaliDate instance set to the final day of the current Bikram Sambat month.
date->endOfYear()
Return a new NepaliDate instance set to the final day of the Bikram Sambat year on the last day of Chaitra.