Convert dd/mm/yyyy to yyyy-mm-dd in php : <p>I need to convert date format in php , But i am getting getting error</p>

<p>here is my code </p>

<pre><code> $test = new DateTime('23/09/2016');
   echo date_format($test, 'Y-m-d');
</code></pre>

<p>But i am getting error as </p>

<pre><code>Message: DateTime::__construct(): Failed to parse time string (23/09/2016) at position 0 (2): Unexpected character 
</code></pre>

<p>How to resolve the issue </p>
