Add X days to an already predefined date in MySQL

2

I need to create a deadline, an expiration date for access

In case I am using to capture the current time, the

"criado" datetime DEFAULT CURRENT_TIMESTAMP,

Where I use CURRENT_TIMESTAMP to get the time of writing in MySQL, after the created has also the "EXPIRES"

How can I add days to the expiration date to have 30 days more than the servant?

Ex2: Created today (2/13/2017) and will expire tomorrow (+1 day) // my question is on this +1 day

    
asked by anonymous 13.02.2017 / 19:16

1 answer

4

You can use the DATE_ADD(criado,INTERVAL 10 DAY) function to add 10 days over the value of the criado field

    
13.02.2017 / 19:20