+2 votes
in Programming Languages by (6.3k points)
Which PHP function should I use to find the day for a given date?

E.g.

10/6/2020 -> Tuesday

1 Answer

0 votes
by (25.6k points)

PHP function jddayofweek() returns the day of the week for a given date.

You need to first convert a Gregorian date to a Julian Day Count and then use PHP function jddayofweek() to get the day.

E.g.

<?php
$jd = gregoriantojd(10,6,2020);
echo jddayofweek($jd, 1);
echo "\n";
?>

The above code will print: Tuesday

Related questions

...