mysql时间相加函数DATE_ADD()

type 参数可以是下列值:

MICROSECOND
SECOND
MINUTE
HOUR
DAY
WEEK
MONTH
QUARTER
YEAR
SECOND_MICROSECOND
MINUTE_MICROSECOND
MINUTE_SECOND
HOUR_MICROSECOND
HOUR_SECOND
HOUR_MINUTE
DAY_MICROSECOND
DAY_SECOND
DAY_MINUTE
DAY_HOUR
YEAR_MONTH

3、例子:

select now();

#2018-08-13 22:44:28

select DATE_ADD(now(),INTERVAL 2 DAY);

#2018-08-15 22:44:28

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zzxpsj.html