strtotime not returning in the proper format
<p>I've some some php that changes the format of the time retrieved from the database:</p>

<pre><code>$selectedDate = $_GET['date'];
$formatedDate = date("Y-d-m",strtotime($selectedDate)); // Y-m-d outputs Y-d-m oddly

echo "&lt;form name='selectedDate' action='info.php' method='GET'&gt;";
    echo "&lt;select name='date' onchange='this.form.submit()'&gt;";
    echo "&lt;option value=select&gt;Select a Date&lt;/option&gt;";
        while ($row = mysql_fetch_array($result))
        {
            $date = date("m-d-Y",strtotime($row['date']));          
            echo "&lt;option&gt;" . $date . "&lt;/option&gt;";
        }
        echo "&lt;/select&gt;";echo "&lt;br /&gt;";

            echo $selectedDate; // 1.) in: 02-13-2013, 2.) in: 02-12-2013
            echo "&lt;br /&gt;";
            echo $formatedDate; // 1.) out: 1970-01-01, 2.) out: 2013-02-12
            echo "&lt;br /&gt;";
        echo date("Y-m-d");

    echo "&lt;noscript&gt;";
    echo "&lt;input type='submit' value='Select'&gt;";
    echo "&lt;/noscript&gt;";
    echo "&lt;/form&gt;";
</code></pre>

<p>Now, for <code>$formatedDate</code>, as stated, if I use <code>Y-m-d</code> for output, I get <code>2013-12-02</code> instead of <code>2013-02-12</code>.  Not to mention that even though all <code>$selectedDate</code>'s are in <code>m-d-Y</code> before being formatted, it doesn't recognize them as <code>dates</code>.  I have the feeling that it's something totally silly that I'm missing, but I just can't see it. </p>

<p>So my question is, why does the <code>strtotime()</code> reverse my month and days, and why does it not recognize all dates?  Is there a better way of getting this done?</p>
