jdtojewish

(PHP 3, PHP 4, PHP 5)

jdtojewish --  Converts a Julian day count to a Jewish calendar date

Description

string jdtojewish ( int juliandaycount [, bool hebrew [, int fl]] )

Converts a Julian Day Count to the Jewish Calendar.

The optional hebrew and fl parameters became available in PHP 5.0.0

If the hebrew parameter is set to TRUE, the fl parameter is used for Hebrew, string based, output format. The available formats are: CAL_JEWISH_ADD_ALAFIM_GERESH, CAL_JEWISH_ADD_ALAFIM, CAL_JEWISH_ADD_GERESHAYIM.

例子 1. jdtojewish() Example

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


add a note add a note User Contributed Notes
gr8g0thamguy at yahoo dot com
02-Sep-2003 02: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 08: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...

<?

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

?>