3

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

2 Answers 2

7

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.

3
0

You can use <?php echo substr($row_rsEnquiriesList['contact_date_e'],0, 14); ?> but is much better to format it on the sql. In this way the date stays as string.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.