JDToGregorian() - 转变一个Julian Day计数为Gregorian历法日期 - php 日历函数
JDToGregorian()
(PHP 4, PHP 5, PHP 7)
转变一个Julian Day计数为Gregorian历法日期
说明
jdtogregorian(int $julianday): string转变一个julian天数为gregorian历法的“月/日/年”形式的日期
参数
$julianday一个julian天数
返回值
“月/日/年”形式的gregorian日期
参见
- gregoriantojd() 转变一个Gregorian历法日期到Julian Day计数
cal_from_jd()
转换Julian Day计数到一个支持的历法。
JD days may have decimal fractions which correspond to the time of day. The Julian day begins at noon, and the decimal fraction measures fractional days until the beginning of the next day at noon. For instance, Julian Day 2453179.00000 is June 22, 2004, at 12:00pm (noon). One hour later, it's 2453179.04167 At 2453179.20833 I'll have dinner, and at 2453179.45833, it's time for the evening news. After a good night of sleep, my alarm will go off at 2453179.83333, then at noon on June 23, a new Julian Day begins at 2453180. To use these functions with fractional days, strip the fractional part with floor(), and apply the function to the integer part. Then add 12 hours, bringing you to noon of that day. That is the actual time returned by JDToGregorian(). Then add the fractional part of the day, by multiplying the decimal part of the Julian Day by (24*60*60) seconds. This may take you forward or backward to a different Gregorian calendar date.
Julian to Gregorian date change. If you do not have the calendar extensions loaded this is little function works realy well.
The minimum acceptable input Julian day count is 1, which produces an output of "11/25/-4714" (at least in my operating system and location) which means 25 November 4714 BC. PHP does not recognize the year 0. Astronomers do use the year 0, and would write the Gregorian date that corresponds to Julian day number 1 as 25 November -4713.
The php gregoriantojd() and jdtogregorian() functions, in addition to the limitations noted by httpwebwitch, does not take account of the 'Astronomical' system of reckoning - i.e. using a year zero, instead of going directly from 1BCE to 1CE, as with the Christian Anno Domini system. These functions can be used to wrap the php built-ins to return ISO 8601 compliant dates:
I have made a slight modification to treebe's jd to greg function, this one will transform a unix timestamp to Gregorian day/month/year format...
内容声明:本文中引用的各种信息及资料(包括但不限于文字、数据、图表及超链接等)均来源于该信息及资料的相关主体(包括但不限于公司、媒体、协会等机构)的官方网站或公开发表的信息。部分内容参考包括:(百度百科,百度知道,头条百科,中国民法典,刑法,牛津词典,新华词典,汉语词典,国家院校,科普平台)等数据,内容仅供参考使用,不准确地方联系删除处理!本站为非盈利性质站点,本着为中国教育事业出一份力,发布内容不收取任何费用也不接任何广告!)