skip to Main Content
    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

4

Answers


  1. You may directly add one year using INTERVAL syntax:

    SELECT DATE_FORMAT(CURDATE() + INTERVAL 1 year, '%e-%b-%y');  -- 27-Dec-23
    
    Login or Signup to reply.
  2. You can use INTERVAL in this case

    SELECT date_format(CURDATE()+ INTERVAL 1 YEAR, '%e-%b-%y')
    
    Login or Signup to reply.
  3. DATE_FORMAT(DATE_ADD(your date, INTERVAL 1 YEAR), '%e-%b-%y')
    
    Login or Signup to reply.
  4. use date_add and interval

    SELECT DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 YEAR), '%e-%b-%y')
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search