What is the day of the week in MySQL? How do I know if a date is a day of the week?

Source: Internet
Author: User

Requirements Description :

In MySQL, if you want to see the day of the week, you can use the Date_format function, which is documented here.

Operation Process :

1. Use the Date_format function to see if a date is the day of the week

Mysql> SelectDate_format ('2018-06-26','%W');#%W (capital W), check out is the date of the week, the full write in English Tuesday +--------------------------------+|Date_format ('2018-06-26','%W')|+--------------------------------+|Tuesday|+--------------------------------+1Rowinch Set(0.00sec) MySQL> SelectDate_format ('2018-06-26','%a');#%A returns the day of the week in English shorthand, Tue, note:abbreviated=a, short  +--------------------------------+|Date_format ('2018-06-26','%a')|+--------------------------------+|Tue|+--------------------------------+1Rowinch Set(0.00sec)

Note : The%a,%w are format strings, and the Date_format function formats the date values according to the format string output.

Document creation time: June 26, 2018 12:35:30

What is the day of the week in MySQL? How do I know if a date is a day of the week?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.