zoukankan      html  css  js  c++  java
  • Date对象 识记

    1、Date 对象创建

    var myDate=new Date()

    2、Date 对象属性

    constructor

    pototype

    3、Date 对象方法

    Date()                  返回当日的日期和时间。

    getDate()              从 Date 对象返回一个月中的某一天 (1 ~ 31)。

    getDay()               从 Date 对象返回一周中的某一天 (0 ~ 6)。

    getMonth()            从 Date 对象返回月份 (0 ~ 11)。

    getFullYear()          从 Date 对象以四位数字返回年份。      

    getHours()             返回 Date 对象的小时 (0 ~ 23)。

    getMinutes()          返回 Date 对象的分钟 (0 ~ 59)。

    getSeconds()         返回 Date 对象的秒数 (0 ~ 59)。

    getMilliseconds()    返回 Date 对象的毫秒(0 ~ 999)。

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

    setDate()               设置 Date 对象中月的某一天 (1 ~ 31)。

    setMonth()             设置 Date 对象中月份 (0 ~ 11)。

    setFullYear()           设置 Date 对象中的年份(四位数字)。

    setHours()              设置 Date 对象中的小时 (0 ~ 23)。

    setMinutes()           设置 Date 对象中的分钟 (0 ~ 59)。

    setSeconds()          设置 Date 对象中的秒钟 (0 ~ 59)。

    setMilliseconds()     设置 Date 对象中的毫秒 (0 ~ 999)。

    setTime()               以毫秒设置 Date 对象。

    parse()                  返回1970年1月1日午夜到指定日期(字符串)的毫秒数。

  • 相关阅读:
    Forms身份验证
    常见的js图片或内轮换效果
    模仿select选择框
    基于jquery的js幻灯片类
    js弹出幕布遮罩层
    css那些事
    选择珠宝js业务逻辑源码
    aspnet帐号密码改了会出问题
    用rails做了个书评排行网站,欢迎光临!
    转发:为什么函数式编程至关重要
  • 原文地址:https://www.cnblogs.com/xuemingyao/p/6282939.html
Copyright © 2011-2022 走看看