如何只显示日期

$date_from1 = new DateTime('1-9-2016');                                 
$thisdate=$date_from1->add(new DateInterval('P1D'));

when I print_r($thisdate);

I am getting the output

DateTime Object ( [date] => 2016-09-02 00:00:00 [timezone_type] => 3 [timezone] => Australia/Sydney )

Expected Output:-

2016-09-02

You need to mention the date format.

Refer to the manual: DateTime::format Example

echo $thisdate->format('Y-m-d H:i:s');

check this

 $date_from1 = date("d/m/Y", strtotime("1-9-2016"));

Based on date-time format manual:- http://php.net/manual/en/datetime.format.php

<?php

$date_from1 = new DateTime('1-9-2016');                                 
$thisdate=$date_from1->add(new DateInterval('P1D'));
//echo "<pre/>";print_r($thisdate);
echo $thisdate->format('Y-m-d');

Output:-

https://eval.in/634751