MySQL Date Functions are used to work with date and time values. They help you retrieve the current date, extract parts of a date, perform date calculations, and format date values for reports and queries.
CURDATE() – Returns current dateNOW() – Returns current date and timeDATE() – Extracts date part from datetimeYEAR(), MONTH(), DAY() – Extract date partsDATE_ADD(), DATE_SUB() – Add or subtract datesDATEDIFF() – Difference between two dates
-- Get current system date
SELECT CURDATE();
-- Get current date and time
SELECT NOW();
-- Extract year from a date
SELECT YEAR('2025-08-15');
-- Add 10 days to a given date
SELECT DATE_ADD('2025-08-15', INTERVAL 10 DAY);
-- Find difference between two dates
SELECT DATEDIFF('2025-08-15', '2025-08-01');
CURDATE() → Returns today’s date (YYYY-MM-DD)NOW() → Returns current date and timeYEAR() → Extracts the year partDATE_ADD() → Calculates a future dateDATEDIFF() → Returns number of days between datesCURDATE() instead of NOW() when time is not required