PHP Velho Oeste 2024

jewishtojd

(PHP 4, PHP 5, PHP 7, PHP 8)

jewishtojd将犹太历日期转换为儒略日数

说明

jewishtojd(int $month, int $day, int $year): int

尽管这个函数可以处理元年(公元前 3761 年)以前的年份,但这样做可能没有意义。 犹太历被用了几千年,但早期的时候一个月的开始没有固定的准则,通常是观察到一个新月后定为一个月份的开始。

参数

month

月份为 113 之间的数字, 1 代表 Tishri13 代表 Elul6 7 代表平年中的 Adar,但在闰年则分别代表 Adar IAdar II

day

天数为 130 之间的数字。如果这个月只有 29 天,则假设第 30 天为下个月的第一天。

year

年份为 1 到 9999 之间的数字

返回值

指定犹太历日期所对应的 int 类型的儒略日。

参见

add a note add a note

User Contributed Notes 2 notes

up
3
erelsgl dot NOSPAM at cs dot technion dot ac dot il
17 years ago
For non-leap years, this function returns the same for month 6 (Adar I) and month 7 (Adar II), so, for example:

<?php
JewishToJD
(6,15,5766) === JewishToJD(7,15,5766)

JDToJewish(JewishToJD(7,15,5766)) === '6/15/5766'
?>
up
0
erelsgl dot NOSPAM at cs dot technion dot ac dot il
17 years ago
JewishToJD returns 0 when the day number is 31 or more.

However, when the day number is 30, JewishToJD returns a valid Julian Day, even when the month only has 29 days. So, for example:
<?php
JDToJewish
(JewishToJD(4,30,5767)) === "5/1/5767"
?>
To Top