[SOLVED] How to add 5 day to selected current date

Issue

How can I select a current date and add 5 day?

I have the current date with some like:

select date_format(now(),'%d-%m-%Y') as date_now;

And I need the date with 5 day add, and I have ( with error):

select date_format(now(),'%d-%m-%Y', interval 5 day) as date_5_day;

How can I add 5 day to the current date?

Solution

Try CURDATE() – function that retrieves the current date without time information.

SELECT DATE_ADD(CURDATE(), INTERVAL 5 DAY);

CURDATE() reference: http://www.w3schools.com/sql/func_curdate.asp

Answered By – horsefeathers

Answer Checked By – Candace Johnson (BugsFixing Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *