方法 用法 描述
    Date.parse() Date.parse(“2012 9 9”)
    // 1347120000000
    该方法返回的毫秒值后三位全为0,精确到秒数,没有毫秒数。
    Date.UTC() Date.UTC(2012,9,9)
    // 1347120000000
    入参格式Date.UTC(year,month,day,hours,minutes,seconds,ms)
    该方法也返回日期的毫秒数,这些参数中只有前两个参数是必需的。
    valueOf() var date = new Date();
    date.valueOf();
    // 1368283579633


    该方法返回的毫秒数精确到毫秒。


    getTime()
    var date = new Date();
    date.getTime();
    // 1368283691951


    该方法返回的毫秒数精确到毫秒,与valueOf()返回的值相同。