

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MySQL's now() +1 day?
The statement now()+1 day itself states that we need to add a day to the current datetime. You can write the above logic like this −
now()+interval 1 day;
Or you can write same logic with date_add() function from MySQL like this −
date_add(now(),interval 1 day);
Let us use the above concept with MySQL select statement. The query is as follows −
mysql> select now()+ interval 1 day;
Here is the sample output that increments a day by 1 −
+-----------------------+ | now()+ interval 1 day | +-----------------------+ | 2018-11-23 15:43:10 | +-----------------------+ 1 row in set (0.05 sec)
Now, let us see another example to use the date_add() function for adding a day to the current date.
The query is as follows −
mysql> select date_add(now(),interval 1 day);
Here is the output −
+--------------------------------+ | date_add(now(),interval 1 day) | +--------------------------------+ | 2018-11-23 15:45:43 | +--------------------------------+ 1 row in set (0.00 sec)
For displaying only the date, then you can use the below logic for now()+1 day.
Use curdate(), instead of now().
curdate()+interval 1 day.
Or you can use the above logic with the help of date_add() function.
date_add(curdate(),interval 1 day);
Here is demo of the above two concepts.
mysql> select curdate()+interval 1 day;
Here is the output that displays only the incremented date with curdate() −
+--------------------------+ | curdate()+interval 1 day | +--------------------------+ | 2018-11-23 | +--------------------------+ 1 row in set (0.00 sec)
The date_add() demo −
mysql> select date_add(curdate(),interval 1 day);
Here is the output that displays only the incremented date with date_add() −
+------------------------------------+ | date_add(curdate(),interval 1 day) | +------------------------------------+ | 2018-11-23 | +------------------------------------+ 1 row in set (0.00 sec)
- Related Questions & Answers
- Select records from MySQL NOW() -1 Day?
- How to make MySQL's NOW() and CURDATE() functions use UTC?
- CURDATE () vs NOW() in MySQL
- How to Celebrate International Women's Day?
- MySQL DateTime Now()+5 days/hours/minutes/seconds?
- Subtracting a day in MySQL
- Theme of International Women’s Day 2018: #PressforProgress
- Fetch date records comparing with the current date’s day and month in MySQL
- What is the difference between MySQL NOW() and SYSDATE()?
- How can we add day/s in the date stored in a column of MySQL table?
- What is the history of women's day celebration?
- What is the difference between MySQL NOW() and CURDATE() function?
- How to apply NOW() to timestamps field in MySQL Workbench?
- Display dates after NOW() + 10 days from a MySQL table?
- Calling NOW() function to fetch current date records in MySQL?