note 125649 added to function.jdtogregorian
| From: | satovey.yahoo.com via php-notes | Date: | Sun, 03 Jan 2021 03:00:45 +0000 |
| Subject: | note 125649 added to function.jdtogregorian | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216052@lists.php.net to get a copy of this message | ||
While fractional are historically permitted, the function in it's current state does not change
the Gregorian date at midnight.
The following is the sample output and as you will note; neither the Jewish date nor the Gregorian
date changes at there expected fractional times.
each julian day hour => 416.625
1pm => 416.625
2pm => 833.25
3pm => 1249.875
4pm => 1666.5
5pm => 2083.125
6pm => 2499.75
7pm => 2916.375
jdCount | jdtoGregorian | jdtoJewish
2453056 | 2/20/2004 | 5/28/5764
2453056.25 | 2/20/2004 | 5/28/5764
2453056.49 | 2/20/2004 | 5/28/5764
2453056.5 | 2/20/2004 | 5/28/5764
2453056.75 | 2/20/2004 | 5/28/5764
Here is the code that outputs the previous data:
<?PHP
echo "<br /><br /> <hr /> <br />";
$totalSeconds =(24*60*60);
$julianDayCountHours = 9999/24;
echo "each julian day hour => ".$julianDayCountHours."<br />";
$hour_1pm = $julianDayCountHours*1;
$hour_2pm = $julianDayCountHours*2;
$hour_3pm = $julianDayCountHours*3;
$hour_4pm = $julianDayCountHours*4;
$hour_5pm = $julianDayCountHours*5;
$hour_6pm = $julianDayCountHours*6;
$hour_7pm = $julianDayCountHours*7;
echo "1pm => ".$hour_1pm."<br />";
echo "2pm => ".$hour_2pm."<br />";
echo "3pm => ".$hour_3pm."<br />";
echo "4pm => ".$hour_4pm."<br />";
echo "5pm => ".$hour_5pm."<br />";
echo "6pm => ".$hour_6pm."<br />";
echo "7pm => ".$hour_7pm."<br />";
//for example
//2453056.49 is on Friday,
//2453056.50 is on Saturday.
//2453056.75 is on Saturday.
$jdCount0 = 2453056;
$jdCount1 = 2453056.2500;
$jdCount2 = 2453056.49;
$jdCount3 = 2453056.50;
$jdCount4 = 2453056.75;
$jdCount5 = 2453056.75;
$jdCount6 = 2453056.75;
$jdCount7 = 2453056.75;
$jdCount8 = 2453056.75;
$jdCount9 = 2453056.75;
echo "jdCount | jdtoGregorian | jdtoJewish<br />";
echo $jdCount0." | ".jdtoGregorian($jdCount0)." |
".jdtoJewish($jdCount0)."<br />";
echo $jdCount1." | ".jdtoGregorian($jdCount1)." |
".jdtoJewish($jdCount1)."<br />";
echo $jdCount2." | ".jdtoGregorian($jdCount2)." | ".
jdtoJewish($jdCount2)."<br />";
echo $jdCount3." | ".jdtoGregorian($jdCount3)." | ".
jdtoJewish($jdCount3)."<br />";
echo $jdCount4." | ".jdtoGregorian($jdCount4)." | ".
jdtoJewish($jdCount4)."<br />";
?>
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.165 (proxied: 68.40.181.66)
----
Manual Page -- http://php.net/manual/en/function.jdtogregorian.php
Edit -- https://master.php.net/note/edit/125649
Del: integrated -- https://master.php.net/note/delete/125649/integrated
Del: useless -- https://master.php.net/note/delete/125649/useless
Del: bad code -- https://master.php.net/note/delete/125649/bad+code
Del: spam -- https://master.php.net/note/delete/125649/spam
Del: non-english -- https://master.php.net/note/delete/125649/non-english
Del: in docs -- https://master.php.net/note/delete/125649/in+docs
Del: other reasons-- https://master.php.net/note/delete/125649
Reject -- https://master.php.net/note/reject/125649
Search -- https://master.php.net/manage/user-notes.php