![]() |
VOOZH | about |
The jdmonthname() function is a built-in function in PHP which returns the month name of a Julian day number passed as the argument. The return value is of six types depending on the mode passed in the function which is explained briefly below in the parameter part. Syntax:
jdmonthname($jd, $mode)
Parameters: The function accepts two parameters as shown above and described below:
Return Value: The function returns the month name depending on the mode passed. If any value other than 0-5 is passed as mode, then the mode is taken as 0. Examples:
Input : $jd = 2458236, $mode = 0 Output : Apr Explanation: In program below we have converted the date(4/27/2018) to the Julian Day integer which is 2458236 Input : $jd = 2457031, $mode = 4 Output : Tevet Explanation: date(1/8/2015) in Julian Day integer is 2457031. Tevet is the month on this Julian Day integer.
Below programs illustrate the jdmonthname() function: Program 1: The program below demonstrates the jdmonthname() function when mode is passed as 0.
Output:
Apr
Program 2: The program below demonstrates the jdmonthname() function when mode is passed as 1.
Output:
April
Program 3: The program below demonstrates the jdmonthname() function when mode is passed as 2.
Output:
Apr
Program 4: The program below demonstrates the jdmonthname() function when mode is passed as 3.
Output:
April
Program 5: The program below demonstrates the jdmonthname() function when mode is passed as 4.
Output:
Iyyar
Program 6: The program below demonstrates the jdmonthname() function when mode is passed out of range.
Output:
Apr
Reference: https://www.php.net/manual/en/function.jdmonthname.php