日期Date 对象常用的方法

    var mydate = new Date();//通过new方法创建对象
    //alert(Date()); // 返回一个完整的日期时间
    // alert(mydate.getDay());//返回当前是周几
    // alert(mydate.getMonth()+1);//返回当前月份
    //alert(mydate.getFullYear());//返回当前年份
    //alert(mydate.getHours());//返回当前小时
    //alert(mydate.getMinutes());//返回当前分钟
    //alert(mydate.getSeconds());//返回当前秒数
原文地址:https://www.cnblogs.com/hello321/p/7859681.html