Unable to separate the date property from the DateTime object. What do I do?
I have used the following code:
while( $fetch = sqlsrv_fetch_array( $stmt , SQLSRV_FETCH_ASSOC) ) {
//echo '<pre>';
print_r($fetch); exit;
$date=$fetch['Dt_Installment_Date'];
echo '<pre>'; print_r($date); exit;
}
The current output that I am getting is as follows:
<pre>DateTime Object
(
[date] => 2019-01-18 00:00:00.000000
[timezone_type] => 3
[timezone] => Europe/Berlin
)
I want to get only the [date] property and nothing else.