new Date(2018,1,1).getDay()===new Date('2018-1-1').getDay()
创建日期:
============1-》以字符串为参数============
-------------------《获取天》---------------------
new Date('2018-08-25').getDay()//6 new Date('2018-08-26').getDay()//0
一周以周日为第一天,周六为最后一天,且起始为0,结束为6
-------------------《获取月》---------------------
new Date('2018-12-26').getMonth()//11 new Date('2018-01-26').getMonth()//0
一年以1月为第一个月,12月为最后一个月,且起始为0,结束为11
==================2=》数字为参数=========
-------------------《获取天》---------------------
-------------------???????????-----------
new Date(2018,8,25).getDay()//2 new Date(2018,8,26).getDay()//3 new Date(2018,8,22).getDay()//6 new Date(2018,8,23).getDay()//0 new Date(2018,8,31).getDay()//1 new Date(2018,9,1).getDay()//1
-------------------《获取月》---------------------
new Date(2018,12,1).getMonth()//0 new Date(2018,11,1).getMonth()//11
一年以12月为第一个月,11月为最后一个月,且起始为0,结束为11
點擊查看更多內容
為 TA 點贊
評論
評論
共同學習,寫下你的評論
評論加載中...
作者其他優質文章
正在加載中
感謝您的支持,我會繼續努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦