WEEKDAY(): function in a mysql date and time field

Returns the Day number within the week from a date .
Syntax
WEEKDAY(date)
Example
SELECT WEEKDAY('2016-09-21')
Output is 2

Using CURDATE()

SELECT WEEKDAY(CURDATE())
This will return weekday in number of present ( today's ) date.

CURDATE()

For a invalid date we will get Null as output
SELECT WEEKDAY('2015-02-31')
Output is NULL Output of WEEKDAY() function is from 0 to 6,
0 for Monday, 1 for Tuesday .... 6 for Sunday
Your Rating




Post your comments , suggestion , error , requirements etc here .










We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer