JavaScript Date 对象简介详细介绍.docVIP

  • 1
  • 0
  • 约2.31千字
  • 约 2页
  • 2021-10-20 发布于天津
  • 举报
JavaScript Date 对象简介 Date 对象用于处理日期和时间。 1.创建 Date 对象的语法: var myDate=new Date(); 2.Date 对象属性 constructor //返回对创建此对象的 Date 函数的引用。 prototype //使您有能力向对象添加属性和方法。 3.Date 对象方法 Date() //返回当日的日期和时间。 getDate() //从 Date 对象返回一个月中的某一天 (1 ~ 31)。 getDay() //从 Date 对象返回一周中的某一天 (0 ~ 6)。 getMonth() //从 Date 对象返回月份 (0 ~ 11)。 getFullYear() // 从 Date 对象以四位数字返回年份。 getYear() //请使用 getFullYear() 方法代替。 getHours() //返回 Date 对象的小时 (0 ~ 23)。 getMinutes() //返回 Date 对象的分钟 (0 ~ 59)。 getSeconds() //返回 Date 对象的秒数 (0 ~ 59)。 getMilliseconds() //返回 Date 对象的毫秒(0 ~ 999)。 getTime() //返回 1970 年 1 月 1 日至今的毫秒数。 ge

文档评论(0)

1亿VIP精品文档

相关文档