I have an event page that displays events from database. In my database, I have a column with datetime format. is there a way to only get the date or time separate from each other in a select to be displayed in PHP ?
Note : I am looking for anything default/core PHP function for this issue.
Use this query , you will get your desired output :
$sql = "SELECT DATE(datecolumn) as mydate, TIME(datecolumn) as mytime FROM `tablename`";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With