Jump to content

Recommended Posts

Hi,

 

I am using the below function to convert and display date in Hebrew characters. It was working till now but it has stopped working since the new year 2013. It is still using 5772 instead of 5773 for the year. Can someone please help me to fix this issue.

 

Thanks

 

function get_hebrew_date($gdate)
{
$cdate = explode("-",$gdate);
$gregorianMonth = $cdate[1];
$gregorianDay = $cdate[0];
$gregorianYear = $cdate[2];

$jdDate = gregoriantojd($gregorianMonth,$gregorianDay,$gregorianYear);
$hebrewMonthName = jdmonthname($jdDate,4);
$hebrewDate = jdtojewish($jdDate);
list($hebrewMonth, $hebrewDay, $hebrewYear) =explode('/',$hebrewDate);
// Hebrew date in hebrew
$str = jdtojewish(gregoriantojd( date('m'), date('d'), date('Y')), true, CAL_JEWISH_ADD_GERESHAYIM + CAL_JEWISH_ADD_ALAFIM + CAL_JEWISH_ADD_ALAFIM_GERESH); // for today
$str1 = iconv ('WINDOWS-1255', 'UTF-8', $str); // convert to utf-8
//echo $str1; // for 23/03/2012 will print: כ"ט אדר ה' אלפים תשע"ב
//echo "<br>";
// or
$str = jdtojewish(gregoriantojd( $gregorianMonth, $gregorianDay, $gregorianYear), true, CAL_JEWISH_ADD_GERESHAYIM); // for today
$str1 = iconv ('WINDOWS-1255', 'UTF-8', $str); // convert to utf-8
return $str1; // for 23/03/2012 will print: כ"ט אדר התשע"ב
}

Link to comment
https://forums.phpfreaks.com/topic/273614-displaying-date-in-hebrew-characters/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.