0
-Good night, you guys!
I have an application that takes data from the database and displays it on the screen. It’s a television schedule, I mean, it shows what’s going on live and what’s going on afterwards.
The type of data representing the time of programming is Datetime
I would like to take only the hour and the minute, ignoring the date. Example: in the bank is like this (2019-08-31 20:50) I want to take only the 20:50 and show on screen. I’m doing with php.
How can I do that?
My current code:
<?php
//SELECT
$gh_resultado = $wpdb->get_results("SELECT * FROM Programacao where horario >= '$gh_data' order by horario");
//Mostrando na tela
echo $gh_resultado[0]->horario;
?>
Use the Mysql TIME(your_field_datetime) function.
– anonimo