创建Date对象:var myDate = new Date()
Date() 返回当前日期和时间
getFullYear() 以四位数字返回年份
getMonth() 返回月份(0~11)
getDate() 返回日期(1~31)
getDay() 返回星期几(0~6)
getHours() 返回小时(0~23)
getMinutes() 返回分钟(0~59)
getSeconds() 返回秒数(0~59)
getMilliseconds() 返回毫秒(0~999)
getTime() 返回自1970年1月1日至今的毫秒数
getTimezoneOffset() 返回格林威治时间和本地时间之间的时差(分钟)
parse() 返回1970年1月1日午夜到指定日期的毫秒数
setDate() 设置Date对象日期(1~31)
setMonth() 设置Date对象月份(0~11)
setFullYear() 设置Date对象四位数字的年份
setHours() 设置Date对象小时
setMinutes() 设置Date对象分钟
setSeconds() 设置Date对象秒数
setMilliseconds() 设置Date对象毫秒
setTime() 以毫秒设置Date对象
本文地址:https://blog.csdn.net/ysgz9749/article/details/107252616
如对本文有疑问, 点击进行留言回复!!
JavaScript中某一标签内函数用this获取不到当前标签的问题笔记
MSAL.js 2.0发布 支持授权代码流 (authorization code flow)
网友评论