jdtojewish
Description
The jdtojewish of Calendar for PHP converts a Julian day count to a Jewish calendar date.
Syntax
jdtojewish(
int $julian_day,
bool $hebrew = false,
int $flags = 0
): stringParameters
julian_day
A julian day number as integer
hebrew
If the hebrew parameter is set to true, the flags parameter is used for Hebrew, ISO-8859-8 encoded string based, output format.
flags
A bitmask which may consist of:
| Value | Constant | Description |
|---|---|---|
| 0 | CAL_JEWISH_ADD_ALAFIM_GERESH | Adds a geresh symbol (which resembles a single-quote mark) as thousands separator to the year number. |
| 1 | CAL_JEWISH_ADD_ALAFIM | Adds the word alafim as thousands separator to the year number. |
| 2 | CAL_JEWISH_ADD_GERESHAYIM | Adds a gershayim symbol (which resembles a double-quote mark) before the final letter of the day and year numbers. |
Return
Returns the Jewish date as a string in the form "month/day/year", or an ISO-8859-8 encoded Hebrew date string, according to the hebrew parameter.
Examples
1 · julian_day
<? $julian_day = unixtojd(); $return = jdtojewish($julian_day); echo $return;
12/11/5786
2 · hebrew
<? $julian_day = unixtojd(); $hebrew = true; $return = jdtojewish($julian_day, $hebrew); $return = mb_convert_encoding($return, "UTF-8", "ISO-8859-8"); echo $return;
יא אב התשפו
3 · flags · CAL_JEWISH_ADD_ALAFIM_GERESH
<? $julian_day = unixtojd(); $hebrew = true; $flags = CAL_JEWISH_ADD_ALAFIM_GERESH; $return = jdtojewish($julian_day, $hebrew, $flags); $return = mb_convert_encoding($return, "UTF-8", "ISO-8859-8"); echo $return;
יא אב ה'תשפו
4 · flags · CAL_JEWISH_ADD_ALAFIM
<? $julian_day = unixtojd(); $hebrew = true; $flags = CAL_JEWISH_ADD_ALAFIM; $return = jdtojewish($julian_day, $hebrew, $flags); $return = mb_convert_encoding($return, "UTF-8", "ISO-8859-8"); echo $return;
יא אב ה אלפים תשפו
5 · flags · CAL_JEWISH_ADD_GERESHAYIM
<? $julian_day = unixtojd(); $hebrew = true; $flags = CAL_JEWISH_ADD_GERESHAYIM; $return = jdtojewish($julian_day, $hebrew, $flags); $return = mb_convert_encoding($return, "UTF-8", "ISO-8859-8"); echo $return;
י"א אב התשפ"ו