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/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

最新文章

  1. 玩转spring boot——AOP与表单验证
  2. .net程序员转行做手游开发经历(四)
  3. Types of compression algorithms
  4. Eclipse中Jsp页面警告的解决方法小结
  5. 移动应用产品开发-android开发 新闻模块开发 百度Frontia组件应用之分享
  6. poj3186 Treats for the Cows
  7. ms_celeb_1m数据提取(MsCelebV1-Faces-Aligned.tsv)python脚本
  8. Java IO详解(六)------序列化与反序列化(对象流)
  9. JS模块化开发----require.js
  10. Spring 依赖注入的理解
  11. Linux通配符应用详解
  12. WordPress 安装插件导致 HTTP 500 内部服务器错误的问题
  13. JProfiler进行Java运行时内存分析
  14. 跨域(五)——postMessage
  15. PHP:第三章——PHP中的递归函数
  16. 即时通信系统Openfire分析之三:ConnectionManager 连接管理
  17. php 连接数据库
  18. 【linux】文件目录说明
  19. vue+vuex+axios从后台获取数据存入vuex,组件之间共享数据
  20. rar 解压

热门文章

  1. H3C 交换机设置telnet WEB用户
  2. python批量修改文件名称
  3. dependencies devDependencies peerDependencies optionalDependencies区别
  4. PowerDesigner生成数据库表和逆向生成表结构(MySQL数据库)
  5. Django---model基础(单表)
  6. ​Php加速原理及工具试验
  7. linux下图形字符的命令
  8. 如何在windows上部署war包到tomcat服务器
  9. android 取mac若干问题
  10. 总结一下内核DEBUG中的dump_stack, BUG, BUG_ON以及panic