以Javascript格式输出日期作为字符串

could you please advice how to output 2012-08-11 in JavaScript as a string without it
showing the results as integer i.e. 1993. I have tried using the .toString() function but
that doesn't work - it stills output it as 1993.
I'm parsing the date 2012-08-11 to a JavaScript function via PHP.

<?php
$year  = 2008;
$month = 8;
$day   = 11; 

echo "<script>";
echo "alert( $year + '-' + $month + '-' + $day )";
echo "</script>";
?>

DEMO

Try this:

var d = new Date(),
    txt = d.getFullYear() + '-' + d.getMonth() + '-' + d.getDate();
alert(d.toUTCString());
alert(d.toDateString());
alert(txt);

For more information, please refer to JavaScript Date Object