php date convert to javascript date
<p>I have a php date and wish to echo it out in a javascript alert box:-</p>

<pre><code>$day=15;
$month=8;
$year=2012;

$date_display = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year));
echo $date_display; // 2012-08-15
</code></pre>

<p>Then,</p>

<pre><code>&lt;a href="#" onclick="give_date(&lt;?=$date_display;?&gt;)"&gt;&lt;?=$day;?&gt;&lt;/a&gt;
</code></pre>

<p>The javascript function:</p>

<pre><code>&lt;script&gt;
function give_date(value){
alert (value);  
}
&lt;/script&gt;
</code></pre>

<p>Interestingly, the alert box give me "1989", which equals to 2012 minus 8 minus 15!! what shall I do!!</p>
