note 125649 deleted from function.jdtogregorian by cmb
| From: | cmb@php.net | Date: | Sun, 03 Jan 2021 11:12:46 +0000 |
| Subject: | note 125649 deleted from function.jdtogregorian by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-216055@lists.php.net to get a copy of this message | ||
Note Submitter: satovey at yahoo dot com
----
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 />";
?>