jdtojewish


php apg

CONVERTS a Julian Day Number, (JDN) to a Jewish Calendar date.



<?php

str jdtojewish 
int $julian_day 
                      
bool $hebrew false 
                         
int $flags )


where,

$julian_day A Julian Day Number, (JDN)

$hebrew To control the output format
                 
SEE the below TABLE )

$flags A bitmask 
        
SEE the below TABLE )

?>

 $julian_day 


A Julian Day Number, (JDN).



 $hebrew 

VALUE WHAT DOES DEFAULT
FALSE The $flags is used for English output format FALSE
TRUE The $flags is used for Hebrew,
ISO-8859-8 encoded string based, output format.
ed48


 $flags 

CONSTANT VALUE WHAT DOES DEFAULT
CAL_JEWISH_ADD_ALAFIM_GERESH 2 axtr a geresh symbol,
(which resembles a single-quote mark),
as thousands separator to the year number
0
CAL_JEWISH_ADD_ALAFIM 4 axtr the word alafim as thousands separator
to the year number
CAL_JEWISH_ADD_GERESHAYIM 8 Add a gershayim symbol,
(which resembles a double-quote mark),
before the final letter of the day and year numbers
ed48




Julian Day Number, (JDN) also known as Julian Day Count, (JDC), indicates the number of days elapsed since January 1, 4713 BC, Gregorian Calendar).

The Julian Calendar was introduced by Júlio Cesar in 46 BC, according the Gregorian Calendar.

The valid range for the Gregorian Calendar) is from November 25, 4714 BC to at least December 31, 9999 AD.

The Jewish Calendar History can be seen in:

Timeline of Jewish History 



  1 EXERCISE   

<?php

$m01  
idate('m');

$d01 idate('d');

$y01  idate('Y');

$jdn01 gregoriantojd($m01$d01$y01);

echo 
$m01 '/' $d01 '/' $y01 
'<sub>( month/day/year ) Gregorian Calendar</sub> = ' 
$jdn01 '<sub>JDN</sub><br><br>';

$jd2jw01a jdtojewish($jdn01); 

echo 
$jdn01 '<sub>JDN</sub> = ' $jd2jw01a
'<sub>( month/day/year ) Jewish Calendar</sub>';

?>

  2 EXERCISE   

<?php

$m02  
idate('m');

$d02 idate('d');

$y02  idate('Y');

$jdn02 gregoriantojd($m02$d02$y02);

echo 
$m02 '/' $d02 '/' $y02 
'<sub>( month/day/year ) Gregorian Calendar</sub> = ' 
$jdn02 '<sub>JDN</sub><br><br>';


$jd2jw02a jdtojewish($jdn02TRUE2); 
// CAL_JEWISH_ADD_ALAFIM_GERESH

$jd2jw02b jdtojewish($jdn02TRUE4); 
// CAL_JEWISH_ADD_ALAFIM

$jd2jw02c jdtojewish($jdn02TRUECAL_JEWISH_ADD_GERESHAYIM);  
// 8


$jd2jw021 iconv('WINDOWS-1255''UTF-8'$jd2jw02a);

$jd2jw022 iconv('WINDOWS-1255''UTF-8'$jd2jw02b);

$jd2jw023 iconv('WINDOWS-1255''UTF-8'$jd2jw02c);

echo 
$jd2jw021 '<br><br>' 
$jd2jw022 '<br><br>' 
$jd2jw023 '<br><br>';

?>