How would I alter my active record to display my date as DD MM YYYY rather than YYYY MM DD?
Current Display
2016-01-07
Aim Display
07-01-2016
Current View
<?php echo $row->start_date; ?>
Tried View
<?php echo $row->DATE_FORMAT(start_date, '%d/%m/%Y'); ?>
Model
class Profiles_model extends CI_Model
{
function get_bank()
{
$this->db->where('mem_id', $this->session->userdata("id"));
$query = $this->db->get('bank');
return $query->result();
}
}
You can use strtotime() and date() of php as :
$originalDate = $row->start_date;
$newDate = date("d-m-Y", strtotime($originalDate));
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