MySQL function note

Source: Internet
Author: User

Mainly by the following links to see, after a supplement to fill the http://blog.csdn.net/phiberg/article/details/7672974http://www.cnblogs.com/zeroone/archive/  2010/05/05/1727659.html/* Get current time */select now ();/* 2014-09-04 10:25:15 */* Get current date */select curdate ();/* 2014-09-04 */ /* Date time plus minus */select curdate (), Date_add (Curdate (), Interval-3 Day),/* 2014-09-04 2014-09-01 */* Get this Monday date, current 2014-09-04, week Four */select curdate (), Subdate (Curdate (), Date_format (Curdate (), '%w ')-1);/* 2014-09-04 2014-09-01 */select Date_add ( Curdate (), Interval-3 Day), Subdate (Date_add (Curdate (), Interval-3 Day), Date_format (Date_add (Curdate (), interval-3 Day), '%w ')-1);/* 2014-09-01 2014-09-01 */* Get this Sunday date, current 2014-09-04, Thursday */select curdate (), Subdate (Curdate (), Date_ Format (curdate (), '%w ')-7);/* 2014-09-04 2014-09-07 */* Get last Monday and last Sunday, currently 2014-09-04, Thursday */select curdate (), Subdate ( Curdate (), Date_format (Curdate (), '%w ') +6), Subdate (Curdate (), Date_format (Curdate (), '%w '));

MySQL function note

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.