Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How to operate dates in MySQL
How to operate dates in MySQL

select curDate(); #Get the current date select curTime(); #Get the current time select now(); #Get the current date + time

List 1 plus or minus days Examples, others can be understood by looking at the English meaning

select date_add(now(), interval 1 day); #Current date + 1

select date_add(now(), interval -1 day); #Current date number of days-1

select date_add(now(), interval 1 hour);

select date_add(now(), interval 1 minute);

select date_add(now(), interval 1 second);

select date_add(now(), interval 1 microsecond);

select date_add(now( ), interval 1 week);

select date_add(now(), interval 1 month);

select date_add(now(), interval 1 quarter);

< p>select date_add(now(), interval 1 year);