Search code examples
mysqldatedate-format

How do I add one year to this MySQL query?


    SELECT date_format(CURDATE(), '%e-%b-%y');

This spits out the date to be 27-Dec-22 and I simply need to run another query so it shows 27-Dec-23


Solution

  • You may directly add one year using INTERVAL syntax:

    SELECT DATE_FORMAT(CURDATE() + INTERVAL 1 year, '%e-%b-%y');  -- 27-Dec-23