jdtojewish

Converts a Julian day count to a Jewish calendar date

Syntax

 jdtojewish(int $julian_day, bool $hebrew = false, int $flags = 0): string

Parameters

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:

NumberConstantDescription
0CAL_JEWISH_ADD_ALAFIM_GERESHAdds a geresh symbol (which resembles a single-quote mark) as thousands separator to the year number.
1CAL_JEWISH_ADD_ALAFIMAdds the word alafim as thousands separator to the year number.
2CAL_JEWISH_ADD_GERESHAYIMAdds a gershayim symbol (which resembles a double-quote mark) before the final letter of the day and year numbers.

Return

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;

?>
10/13/5783

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;

?>
י"ג סיון התשפ"ג
HomeMenu