jddayofweek


php apg

RETURNS the day of week from a Julian Day Number, (JDN).



<?php

int
|str jddayofweek int $julian_day int $mode CAL_DOW_DAYNO )


where,

$julian_day A Julian Day Number, (JDN)

$mode A calendar week modes
              
SEE the below TABLE )

?>

 $julian_day 


A Julian Day Number, (JDN) .



 $mode 

CONSTANT VALUE WHAT DOES DEFAULT
CAL_DOW_DAYNO 0 The day of the week as integer,
where 0 means Sunday and 6 means Saturday
CAL_DOW_DAYNO
CAL_DOW_LONG 1 The English name of the day of the week
English Gregorian
CAL_DOW_SHORT 2 The abbreviated English name of the day of the week
English Gregorian
ed48


  1 EXERCISE   

<?php

$mi 
12;
$di 25;
$yi 33;

$calsi = [ 'CAL_GREGORIAN' => CAL_GREGORIAN,   
               
'CAL_JULIAN' => CAL_JULIAN,   
               
'CAL_JEWISH' => CAL_JEWISH,
               
'CAL_FRENCH' => CAL_FRENCH ];
          
$calsm = [ 'CAL_DOW_DAYNO' => CAL_DOW_DAYNO,   
                 
'CAL_DOW_LONG' => CAL_DOW_LONG,   
                 
'CAL_DOW_SHORT' => CAL_DOW_SHORT ];

          foreach(
$calsi as $cli => $ci)
          {

$c2jd cal_to_jd($ci$mi$di$yi);
echo 
'JDN = ' $c2jd '<br>';

foreach(
$calsm as $clm => $cm)
{
echo 
$clm '<br>';
$jdofwek jddayofweek($c2jd$cm);

echo 
$jdofwek '<br>';

}
echo 
$cli '<br>';
echo 
'<br><br>';
          }

?> 

  2 EXERCISE   

<?php

$mii 
idate('m');
$dii idate('d');
$yii idate('Y');

$calsi = [ 'CAL_GREGORIAN' => CAL_GREGORIAN,   
               
'CAL_JULIAN' => CAL_JULIAN,   
               
'CAL_JEWISH' => CAL_JEWISH,
               
'CAL_FRENCH' => CAL_FRENCH ];
          
$calsm = [ 'CAL_DOW_DAYNO' => CAL_DOW_DAYNO,   
                 
'CAL_DOW_LONG' => CAL_DOW_LONG,   
                 
'CAL_DOW_SHORT' => CAL_DOW_SHORT ];            
          
          foreach(
$calsi as $cli => $ci)
          {

$c2jd cal_to_jd($ci$mii$dii$yii);
echo 
'JDN = ' $c2jd '<br>';

foreach(
$calsm as $clm => $cm)
{
echo 
$clm '<br>';
$jdofwek jddayofweek($c2jd$cm);

echo 
$jdofwek '<br>';

}
echo 
$cli '<br>';
echo 
'<br><br>';
          }

?>