4
So personal.
I need to know if there’s any way to send only the H:i:s hours of the function NOW() in the database, or send the NOW() complete and then fetch only the time?
4
So personal.
I need to know if there’s any way to send only the H:i:s hours of the function NOW() in the database, or send the NOW() complete and then fetch only the time?
5
You can do Insert only with the function now() reminds that to use the time it is necessary to field datetime or timestamp, to display the formatted results use the date function date_format() mysql, use the functions hour, minute or cond to make comparisons.
SELECT DATE_FORMAT(now(), '%H:%i:%s')
//exemplo do sqlfiddle
SELECT id, date_format(data,'%H:%i:%s') FROM datas WHERE hour(data) = 14
4
Try formatting the output value, example:
SELECT DATE_FORMAT(NOW(), '%H:%i:%s');
Browser other questions tagged php mysql sqlfiddle
You are not signed in. Login or sign up in order to post.
You want to get or save the time?
– Oeslei
Both. I need the time exact user device entering brazil or japan and save to database.
– Pedro Quezado
What type of field? date? timestamp?
– rray
date, but what you think best to work can say @rray , but it has to be the exact time.. from where the person is accessing.. has a way of?
– Pedro Quezado