SOURCE

console 命令行工具 X clear

                    
>
console
var  da = new Date();
    var year = da.getFullYear();
    var month = (da.getMonth()+1 < 10 ? '0'+(da.getMonth()+1) : da.getMonth()+1);
    var date = (da.getDate()+1 < 10 ? '0'+(da.getDate()+1) : da.getDate()+1);
    console.log([year,month,date].join(''));

<script src="date.format.js">
var oldTime = (new Date("2012/12/25 20:11:11")).getTime();
//var curTime = (new Date(oldTime)).format("yyyy-MM-dd");
console.log(oldTime.format("yyyy-MM-dd"));
</script>