DATE_ADD() in MySQL — How It Works

What the MySQL DATE_ADD() function does, with an example.

Published October 19, 2026

DATE_ADD(date, INTERVAL n unit) adds a time interval to a date or datetime. Units include DAY, MONTH, YEAR, HOUR and more.

How it works

ADDDATE is a synonym. For subtraction use DATE_SUB or a negative interval.

Try it in MySQL

SELECT DATE_ADD('2026-11-12', INTERVAL 7 DAY)
2026-11-19
SELECT DATE_ADD('2026-01-31', INTERVAL 1 MONTH)
2026-02-28
SELECT NOW() + INTERVAL 2 HOUR
2 hours from now

Practical examples

Example 1

SELECT DATE_ADD('2026-11-12', INTERVAL 7 DAY);
-- 2026-11-19

Example 2

SELECT DATE_ADD('2026-01-31', INTERVAL 1 MONTH);
-- 2026-02-28

Example 3

SELECT NOW() + INTERVAL 2 HOUR;
-- 2 hours from now

Use it in a real query

SELECT id, DATE_ADD('2026-11-12', INTERVAL 7 DAY) AS result
FROM your_table
LIMIT 10;

Common mistakes

  • Month-end surprises (Jan 31 + 1 month).
  • Forgetting the unit keyword.
  • Doing arithmetic on strings.

Key takeaways

  • DATE_ADD() in one line: DATE_ADD(date, INTERVAL n unit) adds a time interval to a date or datetime.
  • Try queries in a test database first.
  • Check NULL handling and data types.

FAQ

Subtract?

Use DATE_SUB or INTERVAL -n unit.

Does DATE_ADD() work in other databases?

Most have an equivalent, but names and syntax vary between MySQL, PostgreSQL, SQL Server and SQLite.

More SQL articles