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


10/6/2020 -> Tuesday

1 Answer

0 votes
by (48.8k 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.


$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
+2 votes
1 answer