Bug #75064 [NEW]: There is no clear description of function jdtogregorian

From: Date: Fri, 11 Aug 2017 14:51:23 +0000
Subject: Bug #75064 [NEW]: There is no clear description of function jdtogregorian
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14888@lists.php.net to get a copy of this message
From: daniel at ohr dot edu Operating system: Mac OS X Sierra PHP version: 7.2.0beta2 Package: Documentation problem Bug Type: Bug Bug description:There is no clear description of function jdtogregorian Description: ------------ --- From manual page: http://www.php.net/function.jdtogregorian --- jdgregorian works but it is not clear how dates are handled JD 1099114 Returns 3/3/-1704 which would be interpreted as 3 Mar 1704 B.C.E. Gregorian (0:00 am) Meeus converts and gets MEU: 3/18/-1703 - i.e. 18 Mar 1703 B.C.E 1721425 returns 12/31/-1 1721426 returns 1/1/1 which shows that there is no year 0 Meeus includes year 0 for astronomers There needs to be clearer documentation about what formula is being used, and what is the starting point for the conversion (25 Nov -4712 Gregorian, JD 1) Because at the moment JD 1 = 25 Nov -4714 which is not correct according to Meeus. Test script: --------------- function jd_to_greg_meeus($J) { $Z = intval($J+0.5); $F = ($J+0.5)-$Z; if ($Z < 2299161) {$A = $Z;} if ($Z >= 2299161) { $alpha = floor(($Z-1867216.25)/36524.25); $A = $Z + 1 + $alpha - floor($alpha/4); } $B = $A + 1524; $C = floor( ($B-122.1)/365.25); $D = floor( 365.25*$C ); $E = floor( ($B-$D)/30.6001 ); $day = floor($B - $D - floor(30.6001*$E)); if ($E < 13.5) { $month = $E - 1;} if ($E > 13.5) { $month = $E - 13;} if ($month > 2.5) { $year = $C - 4716; } if ($month < 2.5) { $year = $C - 4715; } return "$month/$day/$year"; } -- Edit bug report at https://bugs.php.net/bug.php?id=75064&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75064&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75064&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75064&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75064&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75064&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75064&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75064&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75064&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75064&r=support Expected behavior: https://bugs.php.net/fix.php?id=75064&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75064&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75064&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75064&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75064&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75064&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75064&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75064&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75064&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75064&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75064&r=mysqlcfg

« previous php.doc.bugs (#14888) next »