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日午夜到指定日期(字符串)的毫秒数。

  • 相关阅读:
    QQ企业邮箱+Spring+Javamail+ActiveMQ(发送企业邮件)
    Notepad++使用图解
    Sublime Text 2安装图解
    IDE UltraEdit 图文激活+安装教程
    光猫与普通的家用猫
    通过Java Api与HBase交互(转)
    HBase配置性能调优(转)
    HBase Java API类介绍
    hbase shell基础和常用命令详解(转)
    HBase体系结构(转)
  • 原文地址:https://www.cnblogs.com/xuemingyao/p/6282939.html
Copyright © 2011-2022 走看看