In my PHP code I'm using date("N") ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday).
Now when I wanted to make a query to search for a specific date.
I found that in MySQL:
The date_format using %w will return (0=Sunday..6=Saturday)
The DAYOFWEEK(date) will return (1 = Sunday .. 7=Saturday)
Is there a fast way to fix this issue without doing some PHP ?
As is said in the comments:
Subtract or add one (either to PHP or to your MySQL query).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With