Search code examples
mysqldatabasecreate-table

How can i add 4 more days to the current_timestamp on mysql


This is my table schema:

CREATE TABLE `Stoc URGENT` (
  `ID Produs` INT NOT NULL,
  `Data livrari` DATETIME ON UPDATE CURRENT_TIMESTAMP,
  -- other columns

How can I add 4 days to current_timestamp?


Solution

  • Try this:

    `Data livrari` DATETIME ON UPDATE DATE_ADD(CURRENT_TIMESTAMP, INTERVAL 4 DAY)