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:

Number 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

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

julian_day

<?

$julian_day = unixtojd();

$return = jdtojewish($julian_day);

echo $return;

?>
3/24/5782

hebrew

<?

$julian_day = unixtojd();
$hebrew = true;

$return = jdtojewish($julian_day, $hebrew);
$return = mb_convert_encoding($return, "UTF-8", "ISO-8859-8");

echo $return;

?>
כד כסלו התשפב

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;

?>
כד כסלו ה'תשפב

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;

?>
כד כסלו ה אלפים תשפב

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;

?>
כ"ד כסלו התשפ"ב

PHP

Home Menu