interview-answe icon indicating copy to clipboard operation
interview-answe copied to clipboard

220.日期,时间组件方法

Open webVueBlog opened this issue 4 years ago • 1 comments

[js]

webVueBlog avatar May 04 '20 08:05 webVueBlog

getTime()返回表示日期的毫秒数,与valueOf()方法返回的值相同

setTime(毫秒)以毫秒数设置日期,会改变整个日期

getFullYear()取得4位数的年份

getUTCFullFear()返回UTC日期的4位数年份

setFullYear(年) 设置日期的年份

webVueBlog avatar May 04 '20 08:05 webVueBlog