zoukankan      html  css  js  c++  java
  • Date 日期对象

    date对象分为两类   get类和set类

    特殊的:

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

              使用:Date.parse(“月份 日期,年份”)

    get:

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

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

    getFullyear()返回四位数的年份

    getMonth()返回月份 比实际情况小1 0代表1月 0-11

    getHours()返回的当前的 小时数0-23

    getMinutes() 返回当前的分钟数0-59

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

    getTime()返回1970年到现在的毫秒数

    set:

    setDate()设置时间对象中某一天 参数是number 1-31

    setDay()

    setFullYear() 设置年份 参数 year 必填 month 可选 day 可选

    setMonth() 设置月份  参数 month 必填(0-11)day 可选

    setHours() 设置小时数  四个参数 第一个时 必选  其他三个可选

    setMinutes()设置分钟数 三个参数 minutes必选 其他的可选

    setSeconds() 设置秒数 两个参数 seconds必填

  • 相关阅读:
    CF238B Boring Partition
    CF1424G Years
    CF995D Game
    CF468C Hack it!
    CF1417A Copy-paste
    CF1417B Two Arrays
    CF849B Tell Your World
    [洛谷P3389][模板]高斯消元法
    CF1225D
    P6687
  • 原文地址:https://www.cnblogs.com/yangzhiqiang/p/10154301.html
Copyright © 2011-2022 走看看