PHP Set Now to format YYYY-MM-DD
<p>I need to set a variable to the current date in this format: eg: 2012-05-12 , I get that's YYYY-MM-DD ?</p>

<p>I've tried:</p>

<pre><code>$date = date("yyyy-mm-dd", strtotime(now)); 
</code></pre>

<p>but this is not saving the date to mysql so it's coming out as 0000-00-00.</p>

<p>The field is set as type: date in the mysql db.</p>

<p>What am I doing wrong here?</p>
