I am getting value of DOB field and its object of array from DB like this.
echo $value->dob;
got output like this 1989-10-04 00:00:00.000000
I want to display value like 04-10-1989 only.
Please help me out
I am getting value of DOB field and its object of array from DB like this.
echo $value->dob;
got output like this 1989-10-04 00:00:00.000000
I want to display value like 04-10-1989 only.
Please help me out
Try this example
$dob = '1989-10-04 00:00:00.000000';
$new_dob = date('d-m-Y', strtotime($dob));
echo $new_dob;
produces
04-10-1989
Do like this $dob = 'your database date value';
$dob1= date('d-m-Y', strtotime($dob));
echo $dob1;