Neville
Neville

Reputation: 528

Update SQL to Datetime plus 20 minutes

how can I update SQL DATETIME to NOW()+20 minutes

I know I can convert the whole field to varchar and use strototime then add (1200) to the value but I want a direct method to add using NOW() in SQL

Upvotes: 0

Views: 275

Answers (2)

Faisal
Faisal

Reputation: 4765

Try with this below query.Hope it will be help you to solve your problem

UPDATE your_table_name
SET updated_column_name = (
    DATE_ADD(NOW(), INTERVAL 20 MINUTE)
);

Upvotes: 1

Prabhakantha
Prabhakantha

Reputation: 660

please try below command

SELECT DATE_ADD(mi,20, now());  

Upvotes: 0

Related Questions