Course
Simulator
More
Premium
Log in
SQL Function Reference
Functions
ADDDATE
ADDDATE
Returns the date to which the time interval specified by the second parameter has been added
MySQL
ADDDATE
(
datetime
,
INTERVAL
value
unit
)
datetime
Original date
value
Number of added time interval
unit
Added time interval. One of the following values MICROSECOND, SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, QUARTER, YEAR
Type
Description
Format
MICROSECOND
Microseconds
хxxxxx
SECOND
Seconds
ss
MINUTE
Minutes
mm
HOUR
Hours
hh
DAY
Days
DD
WEEK
Weeks
WW
MONTH
Months
MM
QUARTER
Quarters
QQ
YEAR
Years
YY
SECOND_MICROSECOND
Seconds and microseconds
"ss.xxxxxx"
MINUTE_MICROSECOND
Minutes, seconds and microseconds
"mm:ss.xxxxxx"
MINUTE_SECOND
Minutes and seconds
"mm:ss"
HOUR_MICROSECOND
Hours, minutes, seconds and microseconds
"hh:mm:ss.xxxxxx"
HOUR_SECOND
Hours, minutes and seconds
"hh:mm:ss"
HOUR_MINUTE
Hours and minutes
"hh:mm"
DAY_MICROSECOND
Days, hours, minutes, seconds and microseconds
"DD hh:mm:ss.xxxxxx"
DAY_SECOND
Days, hours, minutes and seconds
"DD hh:mm:ss"
DAY_MINUTE
Days, hours and minutes
"DD hh:mm"
DAY_HOUR
Days and hours
"DD hh"
YEAR_MONTH
Years and months
"YY-MM"
Examples
MySQL
SELECT
ADDDATE
(
'2022-06-16'
,
INTERVAL
10
DAY
)