'Get exact time for date mysql

How could I make a query that returns the date of today in addition to the specific hour as '2013-05-12 08:00:00'.. I'd like to make it dynamically, so how could I make it?



Solution 1:[1]

Take a look at this.

I think that CURDATE and CURTIME may do the job. There are alternatives as well, and you can specify a particular format if you wish.

Solution 2:[2]

Use can use MySQL inbuilt function SYSDATE with below query.

select sysdate();

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Frederik.L
Solution 2 Prahalad Gaggar