Question Detail

How to fetch only date from datetime field using php

4 years ago Views 2133 Visit Post Reply

How to fetch only date from datetime field using php


Thread Reply

Anonymous

- 4 years ago

You can use strtotime() and date() of php as :

$originalDate = $row->start_date;
$newDate = date("d-m-Y", strtotime($originalDate));