How to add 5 hours to current time in MySQL?

MySQLMySQLi Database

To add 5 hours in current time, we will use now() function from MySQL. The syntax is as follows −

SELECT date_add(now(),interval some integer value hour);

Now, I am applying the above query to add 5 hours to current time. The query is as follows −

mysql> SELECT date_add(now(),interval 5 hour);

The following is the output

+---------------------------------+
| date_add(now(),interval 5 hour) |
+---------------------------------+
| 2018-10-11 15:59:23             |
+---------------------------------+
1 row in set (0.00 sec)

Look at the output above, it has increased the current time by 5 hours

raja
Published on 22-Oct-2018 09:28:15
Advertisements