Get current hour and minute mysql

0

I would like to know how to get only the time and minute current in Mysql since I have tried several options

The first one shows me hour, minute and second, the others do not work for me.

select time (NOW()) as hora

select DATE_FORMAT time ((now),'%H:%i')

SELECT  DATE_FORMAT(time NOW(), '%H:%i);
    
asked by Alberto Arenas 10.05.2017 в 19:29
source

2 answers

1

I did not understand well but I think you are looking for this line

SELECT DATE_FORMAT(NOW( ), "%H:%i:%S" )

Greetings!

    
answered by 10.05.2017 / 19:41
source
1

Hours HOUR

SELECT HOUR(NOW());

Minutes MINUTE

select MINUTE(now());

Seconds SECOND

select SECOND(now())

Or directly with DATE_FORMAT

SELECT DATE_FORMAT(NOW( ), "%H:%i:%S" ) 
  

For more information check Time and Date Functions

    
answered by 10.05.2017 в 19:40