Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add 6 hours to now() function

Tags:

mysql

I dont know if this is possible. I have researched it and cant find anything. I want to add 6 hours onto the value now() will return. At the moment it comes back in a datetime format in the database.

Is there another function where i can add 6 hours onto the current time? Thankyou

like image 471
sark9012 Avatar asked Jul 16 '10 19:07

sark9012


1 Answers

Use NOW() + INTERVAL 6 HOUR. As an example:

SELECT NOW(), NOW() + INTERVAL 6 HOUR

Result:

'2010-07-16 21:25:17', '2010-07-17 03:25:17'
like image 54
Mark Byers Avatar answered Sep 27 '22 17:09

Mark Byers