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

E.g.

10/6/2020 -> Tuesday

1 Answer

+1 vote
by (346k points)
selected by
 
Best answer

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

+4 votes
2 answers
+3 votes
1 answer

...