devxlogo

Understanding the DAYOFWEEK Function in MySQL

Understanding the DAYOFWEEK Function in MySQL

You can easily find the day of the week for a given date in MySQL. The day starts with 1 (Sunday), 2 (Monday) and so on.

Command:

SELECT DAYOFWEEK('2018-02-20');

Expected output:

+-------------+|DAY OF WEEK  |+-------------+|          3  |+-------------+
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist