Menu Home

jdtojewish

osbo.com | PHP | Functions | jdtojewish

Converts a Julian day count to a Jewish calendar date

Syntax

jdtojewish ( int $julianday [, bool $hebrew = FALSE [, int $fl = 0 ]] ) : string

Parameters

julianday

A julian day number as integer

hebrew

If the hebrew parameter is set to TRUE, the fl parameter is used for Hebrew, ISO-8859-8 encoded string based, output format.

fl

A bitmask which may consist of:

Number Name 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

julianday

<?

$julianday = unixtojd();

$return = jdtojewish($julianday);

echo $return;

?>
9/4/5781

hebrew

<?

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

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

echo $return;

?>
ד אייר התשפא

fl | CAL_JEWISH_ADD_ALAFIM_GERESH

<?

$julianday = unixtojd();
$hebrew = true;
$fl = CAL_JEWISH_ADD_ALAFIM_GERESH;

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

echo $return;

?>
ד אייר ה'תשפא

fl | CAL_JEWISH_ADD_ALAFIM

<?

$julianday = unixtojd();
$hebrew = true;
$fl = CAL_JEWISH_ADD_ALAFIM;

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

echo $return;

?>
ד אייר ה אלפים תשפא

fl | CAL_JEWISH_ADD_GERESHAYIM

<?

$julianday = unixtojd();
$hebrew = true;
$fl = CAL_JEWISH_ADD_GERESHAYIM;

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

echo $return;

?>
ד' אייר התשפ"א

PHP