js中獲取時間new date()的用法 &&js獲取當前日期,格式爲YYYY-MM-DD

var myDate = new Date();//獲取系統當前時間 myDate.getYear(); //獲取當前年份(2位) myDate.getFullYear(); //獲取完整的年份(4位,1970-????) myDate.getMonth(); //獲取當前月份(0-11,0表明1月) myDate.getDate(); //獲取當前日(1-31) myDate.getDay();
相關文章
相關標籤/搜索