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


10/6/2020 -> Tuesday

1 Answer

+1 vote
by (353k 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.


$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