date对象方法

创建Date       new Date()

Date对象方法:

  get系列

    getDate()          返回一个月中的某一天(1~31)

    getDay()           返回一周中的某一天(0~6)

    getFullYear()    返回四位数的年份

    getMonth()      返回月份(0~11   0是一月)

    getHours()      返回的是当前的小时(0~23)

    getMinutes()   返回的是当前的分钟(0~59)

    getSeconds()  返回的是当前的秒数(0~59)

    getTime()         返回的是1970年1月1日至今的毫秒数

  set系列

    parse()           返回1970年1月1日到指定日期的毫秒数

        setDate()       设置一月的某一天(1~31)

    setFullYear()  设置年份

    setMonth()    设置月份(0~11)

    setHours()     设置小时(0~23)

    setMinutes()  设置分钟(0~59)

    setSeconds() 设置秒数  (0~59)

    setTime()       以毫秒设置Date

原文地址:https://www.cnblogs.com/bokeyanghao/p/10133591.html