一月 Jan. January
二月 Feb. February
三月 Mar. March
四月 Apr. April
五月 May. May
六月 Jun. June
七月 Jul. July
八月 Aug. August
九月 Sept. September
十月 Oct. October
十一月 Nov. November
十二月 Dec. December
Date对象 – 时间
创建一个日期对象
var today = new Date()
var d1 = new Date("October 13, 1975 11:13:00")
var d2 = new Date(79,5,24)
var d3 = new Date(79,5,24,11,33,0)
console.log(today,d1,d2,d3)
getDate() 获取当前日期对象时几日
var today = new Date()
console.log(today.getDate())
console.log(d1.getDate())
console.log(d2.getDate())
console.log(d3.getDate())
getDay() 获取当前日期对象是星期几
var today = new Date()
console.log(today.getDay())
getMonth() 获取当前日期对象是几月 0 - 11月
var today = new Date()
console.log(today.getMonth())//9 +1 =10
getFullYear() 获取当前日期对象的年
var today = new Date()
console.log(today.getFullYear())
getTime()获取当前时间戳
console.log(today.getTime())
var myDate=new Date();
myDate.setFullYear(2010,0,14);
console.log(myDate)