Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Calendar Functions : jdtojewish

jdtojewish

Converts a Julian day count to a Jewish calendar date (PHP 4, PHP 5)
string jdtojewish ( int juliandaycount [, bool hebrew [, int fl]] )

Example 370. jdtojewish() Example

<?php
echo jdtojewish(gregoriantojd(10, 8, 2002), true,
     
CAL_JEWISH_ADD_GERESHAYIM + CAL_JEWISH_ADD_ALAFIM + CAL_JEWISH_ADD_ALAFIM_GERESH);
?>

Code Examples / Notes » jdtojewish

asphp

This function outputs in ISO-8859-8-l.
To convert to unicode UTF-8 do this:
<?
echo mb_convert_encoding( jdtojewish( unixtojd(), true ), "UTF-8", "ISO-8859-8");
?>


dave_at_mitzvahweb.com

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...
<?
//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";
?>


gr8g0thamguy

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";
?>


Change Language


Follow Navioo On Twitter
cal_days_in_month
cal_from_jd
cal_info
cal_to_jd
easter_date
easter_days
FrenchToJD
GregorianToJD
JDDayOfWeek
JDMonthName
JDToFrench
JDToGregorian
jdtojewish
JDToJulian
jdtounix
JewishToJD
JulianToJD
unixtojd
eXTReMe Tracker