ylbtech-Java-API:java.util.Date
Module java.base
Package java.util

Class Date

1.返回顶部
1、
  • Constructor Summary

    Constructors
    Constructor Description
    Date()
    Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.
    Date​(int year, int month, int date)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date) or GregorianCalendar(year + 1900, month, date).
    Date​(int year, int month, int date, int hrs, int min)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).
    Date​(int year, int month, int date, int hrs, int min, int sec)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec).
    Date​(long date)
    Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
    Date​(String s)
    Deprecated.

    As of JDK version 1.1, replaced by DateFormat.parse(String s).
  • Method Summary

    All MethodsStatic MethodsInstance MethodsConcrete MethodsDeprecated Methods
    Modifier and Type Method Description
    boolean after​(Date when)
    Tests if this date is after the specified date.
    boolean before​(Date when)
    Tests if this date is before the specified date.
    Object clone()
    Return a copy of this object.
    int compareTo​(Date anotherDate)
    Compares two Dates for ordering.
    boolean equals​(Object obj)
    Compares two dates for equality.
    static Date from​(Instant instant)
    Obtains an instance of Date from an Instant object.
    int getDate()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_MONTH).
    int getDay()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.DAY_OF_WEEK).
    int getHours()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.HOUR_OF_DAY).
    int getMinutes()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.MINUTE).
    int getMonth()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.MONTH).
    int getSeconds()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.SECOND).
    long getTime()
    Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
    int getTimezoneOffset()
    Deprecated.

    As of JDK version 1.1, replaced by -(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000).
    int getYear()
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.get(Calendar.YEAR) - 1900.
    int hashCode()
    Returns a hash code value for this object.
    static long parse​(String s)
    Deprecated.

    As of JDK version 1.1, replaced by DateFormat.parse(String s).
    void setDate​(int date)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.DAY_OF_MONTH, int date).
    void setHours​(int hours)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.HOUR_OF_DAY, int hours).
    void setMinutes​(int minutes)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.MINUTE, int minutes).
    void setMonth​(int month)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.MONTH, int month).
    void setSeconds​(int seconds)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.SECOND, int seconds).
    void setTime​(long time)
    Sets this Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
    void setYear​(int year)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900).
    String toGMTString()
    Deprecated.

    As of JDK version 1.1, replaced by DateFormat.format(Date date), using a GMT TimeZone.
    Instant toInstant()
    Converts this Date object to an Instant.
    String toLocaleString()
    Deprecated.

    As of JDK version 1.1, replaced by DateFormat.format(Date date).
    String toString()
    Converts this Date object to a String of the form:
    static long UTC​(int year, int month, int date, int hrs, int min, int sec)
    Deprecated.

    As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec), using a UTC TimeZone, followed by Calendar.getTime().getTime().
2、
2.返回顶部
 
3.返回顶部
 
4.返回顶部
 
5.返回顶部
0、
1、
 
6.返回顶部
 
作者:ylbtech
出处:http://ylbtech.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

Java-API:java.util.Date的更多相关文章

  1. 8.算法竞赛中的常用JAVA API :Calendar日期类

    8.算法竞赛中的常用JAVA API :Calendar日期类 摘要 在蓝桥杯中有关于日期计算的问题,正好java中的Date类和Calendar类提供了对日期处理的一些方法.Date类大部分方法已经 ...

  2. 算法竞赛中的常用JAVA API :大数类(转载)

    5.算法竞赛中的常用JAVA API :大数类 摘要 java中的基础数据类型能存储的最大的二进制数是 2 ^ 63 - 1 对应的十进制数是9223372036854775807(long类型的最大 ...

  3. 算法竞赛中的常用JAVA API:PriorityQueue(优先队列)(转载)

    算法竞赛中的常用JAVA API:PriorityQueue(优先队列) PriorityQueue 翻译过来就是优先队列,本质是一个堆, 默认情况下堆顶每次都保留最小值,每插入一个元素,仍动态维护堆 ...

  4. 算法竞赛中的常用JAVA API :HashSet 和 TreeSet(转载)

    算法竞赛中的常用JAVA API :HashSet 和 TreeSet set set容器的特点是不包含重复元素,也就是说自动去重. HashSet HashSet基于哈希表实现,无序. add(E ...

  5. 算法竞赛中的常用JAVA API :HashMap 和 TreeMap(转载)

    算法竞赛中的常用JAVA API :HashMap 和 TreeMap 摘要 本文主要介绍Map接口下的HashMap和TreeMap. HashMap HashMap是基于哈希表的 Map 接口的实 ...

  6. 7.算法竞赛中的常用JAVA API :String 、StringBuilder、StringBuffer常用方法和区别(转载)

    7.算法竞赛中的常用JAVA API :String .StringBuilder.StringBuffer常用方法和区别 摘要 本文将介绍String.StringBuilder类的常用方法. 在j ...

  7. 6.算法竞赛中的常用JAVA API :Math类(转载)

    6.算法竞赛中的常用JAVA API :Math类 求最值 最小值 Math.min(int a, int b) Math.min(float a, float b) Math.min(double ...

  8. Java-杂项-java.nio:java.nio

    ylbtech-Java-杂项-java.nio:java.nio java.nio全称java non-blocking IO,是指jdk1.4 及以上版本里提供的新api(New IO) ,为所有 ...

  9. java面试:java基础、Io、容器

    1.java基础 1.JDK 和JRE有什么区别 ​ JDK:java开发工具包,java开发运行环境.包含了JRE. ​ JRE:java运行环境,包含java虚拟机,java基础类库. 2.jav ...

  10. Java基础:Java的四种引用

    在Java基础:java虚拟机(JVM)中,我们提到了Java的四种引用.包括:强引用,软引用,弱引用,虚引用.这篇博客将详细的讲解一下这四种引用. 1. 强引用 2. 软引用 3. 弱引用 4. 虚 ...

随机推荐

  1. Docker 数据管理-bind mount

    Use bind mounts Bind mounts have been around since the early days of Docker. Bind mounts have limite ...

  2. Oracle基本概念

    1. 数据库和实例 什么是数据库,其实很简单,数据库就是存储数据的一种媒介.比如常用的文件就是一种,在Oracle10g中,数据的存储有好几种.第一种是文件形 式,也就是在你的磁盘中创建一批文件,然后 ...

  3. HTTP Status 500:报错Unsupported major.minor version 51.0(unable to load class XXX)

    这个是jdk版本和JRE不匹配导致的. 报错信息: 问题详解:(待填) 处理: 1.检查jdk和jre版本是否匹配 ——打开命令行界面(cmd),分别输入java -version 和javac -v ...

  4. 在移动端做查看日志信息的js

    Vconsole.js下载这个js引入需要使用的html文件,当运行到页面是就会在右下角显示提示,点击就出出现像pc端上的控制台页面 在线查看的网址 http://console.hongliang. ...

  5. 安装Tomcat服务器以及错误汇总(tomcat8.0、jdk8)

    Tomcat安装和启动 一.下载Tomcat 你可以直接百度Tomcat官网, 或者,直接在地址栏输入他的官网地址:http://tomcat.apache.org/,然后进入他的主页,在主页左侧可以 ...

  6. Flume-NG源码阅读之HDFSEventSink

    HDFSEventSink是flume中一个很重要的sink,配置文件中type=hdfs.与此sink相关的类都在org.apache.flume.sink.hdfs包中. HDFSEventSin ...

  7. graphlab 安装好后的导入配置

    本以为下好了的结果... 然后等个十几二十分钟... 关掉这个页面重新打开,再重新导入graphlab 貌似好了...但是,,, 发现是自己的文件放错盘了...在F盘... 然后就好啦~

  8. js的constructor

    js创建一个构造函数,会默认在原型链上添加一个constructor的属性,它保存了构造函数内的代码. 一般情况下我们不需要去改动它,但是有些时候我们会不经意的改写它. 比如下面这个例子: var F ...

  9. JavaScrip 原生多文件上传及预览 兼容多浏览器

    JavaScrip 原生多文件上传及预览 兼容多浏览器 html代码块 <div class="container"> <label>请选择一个图像文件:& ...

  10. VS2010 + QT 5 +open inventor 环境配置

    本科毕业设计做的是   随钻测量的井眼轨迹和测井曲线的三维显示  要求的环境是  QT +  Open Inventor    在寒假开学前,打算将环境配置好,开学后再正式编码实现,可是....环境也 ...