Working with Date Functions in MySQL

Published July 26, 2025 By Sai Sree Ram Gundepudi

Examples

SELECT NOW();
SELECT DATEDIFF('2025-12-31', '2025-01-01');
SELECT DATE_ADD(NOW(), INTERVAL 7 DAY);
SELECT DATE_FORMAT(NOW(), '%d-%m-%Y');

Was this solution helpful?

Your feedback helps improve our technical knowledge repository.

Share this article