This function outputs in ISO-8859-8-l.
To convert to unicode UTF-8 do this:
<?php
echo mb_convert_encoding( jdtojewish( unixtojd(), true ), "UTF-8", "ISO-8859-8");
?>
jdtojewish
(PHP 4, PHP 5)
jdtojewish — Convierte de cuenta de días juliana a calendario judío
Descripción
string jdtojewish
( int $diajuliano
[, bool $hebreo
[, int $fl
]] )
Convierte una cuenta de días juliana al calendario judío.
Los parámetros opcionales hebreo y fl está disponibles a partir de PHP 5.0.0
Si al parámetro hebreo se le asigna el valor TRUE, el parámetro fl se usa para el formato de salida hebreo. Los formatos disponibles son: CAL_JEWISH_ADD_ALAFIM_GERESH, CAL_JEWISH_ADD_ALAFIM, CAL_JEWISH_ADD_GERESHAYIM.
Example #1 Ejemplo jdtojewish()
<?php
echo jdtojewish(gregoriantojd(10,8,2002), true,
CAL_JEWISH_ADD_GERESHAYIM + CAL_JEWISH_ADD_ALAFIM + CAL_JEWISH_ADD_ALAFIM_GERESH);
?>
jdtojewish
asphp at dsgml dot com
28-May-2007 11:10
28-May-2007 11:10
gr8g0thamguy at yahoo dot com
01-Sep-2003 08:39
01-Sep-2003 08:39
Based on the code already posted by Dave, I've modified it to display the *current* date on a page:
<?php
$gregorianMonth = date(n);
$gregorianDay = date(j);
$gregorianYear = date(Y);
$jdDate = gregoriantojd($gregorianMonth,$gregorianDay,$gregorianYear);
$hebrewMonthName = jdmonthname($jdDate,4);
$hebrewDate = jdtojewish($jdDate);
list($hebrewMonth, $hebrewDay, $hebrewYear) = split('/',$hebrewDate);
echo "$hebrewDay $hebrewMonthName $hebrewYear";
?>
dave_at_mitzvahweb.com
05-Mar-2002 01:04
05-Mar-2002 01:04
There's probably a simpler way to do this, but I needed to convert a Gregorian date to a Hebrew one and display it with the Hebrew month name (not the number).
Perhaps it can help somebody...
<?php
//enter your Gregorian date with the variables $gregorianMonth, $gregorianDay, and $gregorianYear using the numerical representation of the month
$jdDate = gregoriantojd ( $gregorianMonth, $gregorianDay, $gregorianYear);
$gregorianMonthName = jdmonthname ( $jdDate, 1 );
$hebrewDate = jdtojewish ($jdDate);
list ($hebrewMonth, $hebrewDay, $hebrewYear) = split ('/', $hebrewDate);
$hebrewMonthName = jdmonthname ( $jdDate, 4);
echo "Your date in Hebrew would read: $hebrewDay $hebrewMonthName $hebrewYear";
?>
