PHP and JavaScript Dates don't match - Strange anomaly
<p>HTML/PHP:   </p>

<pre><code>&lt;button onclick="change_value(&lt;?php echo $date?&gt;)"&gt;Go&lt;/button&gt;
</code></pre>

<p>JavaScript: </p>

<pre><code>function change_value(date_used)
{
    alert(date_used);
}
</code></pre>

<p>When I right-click on the button and click the "Inspect Element" button shows the parameter correctly, i.e something like this:</p>

<pre><code>&lt;button onclick="change_value(2012-08-22)"&gt;Go&lt;/button&gt;
</code></pre>

<p>But the <code>alert</code> in the JavaScript is displaying <code>1981</code>. That's it - only <code>1981</code>. Not only the date is wrong, but the format, too.</p>

<p>What is this happening and how can I fix it?</p>
