Question Detail

How to fetch only date from datetime field using php

6 years ago Views 3012 Visit Post Reply

How to fetch only date from datetime field using php


Thread Reply

Anonymous

- 6 years ago

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

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