Add X days on a predefined date in Mysql

Asked

Viewed 561 times

2

I need to create a deadline, an access expiration date

in the case I am using to capture the current time the

"criado" datetime DEFAULT CURRENT_TIMESTAMP,

Where I use the CURRENT_TIMESTAMP to get the time of recording in Mysql, after the created tbm has the "EXPIRES"

How can I add days so that in the expiration has 30 days more than the servant?

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

1 answer

4


You can use the function DATE_ADD(criado,INTERVAL 10 DAY) will add 10days upon field value criado

Browser other questions tagged

You are not signed in. Login or sign up in order to post.