Methods
date->getYear()
Retrieve the four digit Bikram Sambat year number from a NepaliDate instance.
The getYear method returns the full four digit Bikram Sambat year as an integer for the current NepaliDate instance. It returns the complete calendar year such as 2081 within the supported range of 1976 through 2100 BS.
Import
use NepaliDateLibrary\NepaliDate;Signature
public function getYear(): int;Parameters
- None.
Return Value
- Type:
int - Range:
1976to2100 - Description: Four digit Bikram Sambat year integer.
Example
use NepaliDateLibrary\NepaliDate;
$date = new NepaliDate('2081-07-15');
echo $date->getYear(); // 2081Related
date->setYear(): Mutate the year component.date->getMonth(): Retrieve the month component.
Advertisement
Instance Properties & Getters
Guide to property encapsulation and public getters available on every NepaliDate instance in PHP.
date->getMonth()
Retrieve the zero based Bikram Sambat month index from zero for Baisakh to eleven for Chaitra.