ADDDATE(date,INTERVAL expression type)
Description: Returns the date that results from adding an interval expression to date (a DATE or DATETIME type), where the interval is of type as shown in Table C.1.
If date is of type DATE and type contains only year, month, and day calculations, a date will result; if date is of type DATETIME or type includes hour, minute, or second calculations, a date and time will result.
ADDDATE() is synonymous with DATE_ADD() and +.
Value of type | Format for expression |
---|---|
SECOND | ss |
MINUTE | mm |
HOUR | hh |
DAY | DD |
MONTH | MM |
YEAR | YY |
MINUTE_SECOND | "mm:ss" |
HOUR_MINUTE | "hh:mm:ss" |
DAY_HOUR | "DD hh" |
YEAR_MONTH | "YY-MM" |
HOUR_SECOND ... |
Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.