SQL
MySQL DAYOFWEEK() Function
Return the weekday index for a date: