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