PHP - Function jdmonthname()


Advertisements


Syntax

jdmonthname ( $julianday [, $mode] );

Definition and Usage

This function returns a string containing a month name. mode tells this function which calendar to convert the Julian Day Count to, and what type of month names are to be returned.

Parameters

Sr.No Parameter & Description
1

julianday

Required. The Julian Day to operate on

2

mode

Optional. Defines which calendar to convert the Julian day count to, and what type of month names are to be returned. Mode values −

  • 0 − Gregorian - abbreviated (Jan, Feb, Mar, etc.)
  • 1 − Gregorian (January, February, March, etc.)
  • 2 − Julian - abbreviated (Jan, Feb, Mar, etc.)
  • 3 − Julian (January, February, March, etc.)
  • 4 − Jewish (Tishri, Heshvan, Kislev, etc.)
  • 5 − French Republican (Vendemiaire, Brumaire, Frimaire, etc.)

Return Value

The month name for the given Julian Day and calendar.

Example

Try out following example −

<?php
   $jd = cal_to_jd(CAL_GREGORIAN,date("m"),date("d"),date("Y"));
   echo(jdmonthname($jd,1));
?> 

This will produce the following result −

January

php_function_reference.htm

Advertisements