SELECT DAYNAME('2016-08-24')
Output is Wednesday
DAYNAME()
Example :
SELECT DAYNAME(CURDATE())
Output is Wednesday
SELECT DAYNAME(NOW())
Output is Wednesday
SELECT DAYNAME(CURDATE()- interval 1 day) as YesterDay,
DAYNAME(CURDATE()) as Today,
DAYNAME(CURDATE()+ interval 1 Day) as Tomorrow
YesterDay | Today | Tomorrow |
Tuesday | Wednesday | Thursday |
<?Php
require 'config.php'; // Database connection string
$query='SELECT DAYNAME(CURDATE()) as dt';
// Change the above Query part to get different results //
$count=$dbo->prepare($query);
$count->execute();
$row = $count->fetch(PDO::FETCH_OBJ);
echo 'Output is : '.$row->dt;
?>
SQL Date MONTHNAME() : Month name in Full ( November )