I want to change date only without the timestamp part. I’m trying to change from phpMyAdmin. So it doesn’t execute 3 parameters of DATEDIFF.
For e.g:
post_date |
---|
2020-12-16 23:20:48 |
2020-12-16 23:40:42 |
Add 4 days
post_date |
---|
2020-12-20 23:20:48 |
2020-12-20 23:40:42 |
OR Change date to current date (Today is 28th of December 2020)
post_date |
---|
2020-12-28 23:20:48 |
2020-12-28 23:40:42 |
2
Answers
You could adjust it with an interval:
If you want to translate the stored date to today’s date, you can do:
Or using string operations:
The other question is just simple date arithmetics. You can add 4 days to a date by adding an interval, like: