Static Methods
NepaliDate::getMonthName()
Static utility to retrieve the localized English or Nepali month name for any month index.
The getMonthName static method returns the localized name of a Bikram Sambat month given its zero based index from 0 for Baisakh to 11 for Chaitra. It supports full names as well as short abbreviations in both English and Devanagari script.
Import
use NepaliDateLibrary\NepaliDate;Signature
public static function getMonthName(
int $month,
bool $short = false,
bool $nepali = false
): string;Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
$month | int | Yes | - | Zero based month index from 0 to 11. |
$short | bool | No | false | Return abbreviated three letter or short string. |
$nepali | bool | No | false | Return name in native Devanagari Nepali script. |
Return Value
- Type:
string - Description: Localized month name string.
Examples
use NepaliDateLibrary\NepaliDate;
// English full name (Kartik is index 6)
echo NepaliDate::getMonthName(6) . PHP_EOL; // "Kartik"
// English abbreviation
echo NepaliDate::getMonthName(6, true) . PHP_EOL; // "Kar"
// Devanagari full name
echo NepaliDate::getMonthName(6, false, true) . PHP_EOL; // "कार्तिक"
// Devanagari abbreviation
echo NepaliDate::getMonthName(6, true, true) . PHP_EOL; // "का"Related
NepaliDate::getDayName(): Retrieve localized weekday names.Constants::$MONTH_EN: Complete list of English month names.
Advertisement
NepaliDate::maximum()
Static method returning the maximum supported date boundary for the NepaliDate calendar engine.
NepaliDate::getDayName()
Static utility to retrieve the localized English or Nepali name for any day of the week index.