JS-Date对象

    //Date.now() is in ECMAScript 5
    //Prior to that, use +new Date()
    var now = (typeof Date.now == "function" ? Date.now() : +new Date());
    console.log("Right now: " + now);
    //January 1, 2000 at midnight in local time
    var y2k = new Date(2000, 0);
    console.log(y2k.toLocaleString());
    //May 5, 2005 at 5:55:55 PM in local time 月份从0开始,即:0 ==> 1月;1==>2月...
    var allFives = new Date(2005, 4, 5, 17, 55, 55);
    console.log(allFives.toLocaleString());
    var now = new Date();
    cosnole.log(now);
    var someDate = new Date(Date.parse("May 25, 2004"));
    cosnole.log(someDate);
    //January 1, 2000 at midnight
    var y2k = new Date(Date.UTC(2000, 0));
    console.log(y2k.toUTCString());
    //May 5, 2005 at 5:55:55 PM GMT
    var allFives = new Date(Date.UTC(2005, 4, 5, 17, 55, 55));
    console.log(allFives.toUTCString());