Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove seconds when displaying a datetime database value

I have an html form that uses jQuery datetimepicker to send a value to a database but with out seconds so the value created in the database 'datetime column always has '00' for the seconds. I want to remove the seconds when I display the value on a webpage. I currently have:

<?php echo $row_rsEnquiriesList['contact_date_e']; ?>

which displays something like this - 26-12-08 12:40:00.

I would like it to display this - 26-12-08 12:40

like image 961
Steve Joiner Avatar asked Jun 12 '26 08:06

Steve Joiner


1 Answers

You can do it as follow

<?php 

echo date('d-m-y H:i',strtotime($row_rsEnquiriesList['contact_date_e']));

?>

It will remove seconds. and you can remove anything you need.

like image 140
Gowtham Avatar answered Jun 14 '26 20:06

Gowtham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!