Languages
[Edit]
EN

MySql - subtract days from current date

16 points
Created by:
Emelia
517

In MySql, there is available DATE_ADD() function that helps to subtract days from some date. In this example we presented way how to subtract some days from current date.

1. DATE_ADD() with NOW() functions example

This example subtracts 30 days from current time.

SELECT DATE_ADD(NOW(), INTERVAL -30 DAY);

Result:

Subtract 30 days from current date operation in MySql with HeidiSQL.
Subtract 30 days from current date operation in MySql with HeidiSQL.
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

MySQL - dates

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join