Java-API:java.util.Date
| ylbtech-Java-API:java.util.Date |
- java.lang.Object
- java.util.Date
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<Date>
| 1.返回顶部 |
Constructor Summary
Constructors Constructor Description Date()Allocates aDateobject 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 byCalendar.set(year + 1900, month, date)orGregorianCalendar(year + 1900, month, date).Date(int year, int month, int date, int hrs, int min)Deprecated.As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date, hrs, min)orGregorianCalendar(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 byCalendar.set(year + 1900, month, date, hrs, min, sec)orGregorianCalendar(year + 1900, month, date, hrs, min, sec).Date(long date)Allocates aDateobject 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 byDateFormat.parse(String s).
Method Summary
All MethodsStatic MethodsInstance MethodsConcrete MethodsDeprecated Methods Modifier and Type Method Description booleanafter(Date when)Tests if this date is after the specified date.booleanbefore(Date when)Tests if this date is before the specified date.Objectclone()Return a copy of this object.intcompareTo(Date anotherDate)Compares two Dates for ordering.booleanequals(Object obj)Compares two dates for equality.static Datefrom(Instant instant)Obtains an instance ofDatefrom anInstantobject.intgetDate()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.DAY_OF_MONTH).intgetDay()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.DAY_OF_WEEK).intgetHours()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.HOUR_OF_DAY).intgetMinutes()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.MINUTE).intgetMonth()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.MONTH).intgetSeconds()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.SECOND).longgetTime()Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by thisDateobject.intgetTimezoneOffset()Deprecated.As of JDK version 1.1, replaced by-(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / (60 * 1000).intgetYear()Deprecated.As of JDK version 1.1, replaced byCalendar.get(Calendar.YEAR) - 1900.inthashCode()Returns a hash code value for this object.static longparse(String s)Deprecated.As of JDK version 1.1, replaced byDateFormat.parse(String s).voidsetDate(int date)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.DAY_OF_MONTH, int date).voidsetHours(int hours)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.HOUR_OF_DAY, int hours).voidsetMinutes(int minutes)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MINUTE, int minutes).voidsetMonth(int month)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MONTH, int month).voidsetSeconds(int seconds)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.SECOND, int seconds).voidsetTime(long time)Sets thisDateobject to represent a point in time that istimemilliseconds after January 1, 1970 00:00:00 GMT.voidsetYear(int year)Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.YEAR, year + 1900).StringtoGMTString()Deprecated.As of JDK version 1.1, replaced byDateFormat.format(Date date), using a GMTTimeZone.InstanttoInstant()Converts thisDateobject to anInstant.StringtoLocaleString()Deprecated.As of JDK version 1.1, replaced byDateFormat.format(Date date).StringtoString()Converts thisDateobject to aStringof the form:static longUTC(int year, int month, int date, int hrs, int min, int sec)Deprecated.As of JDK version 1.1, replaced byCalendar.set(year + 1900, month, date, hrs, min, sec)orGregorianCalendar(year + 1900, month, date, hrs, min, sec), using a UTCTimeZone, followed byCalendar.getTime().getTime().
| 2.返回顶部 |
| 3.返回顶部 |
| 4.返回顶部 |
| 5.返回顶部 |
| 6.返回顶部 |
![]() |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
Java-API:java.util.Date的更多相关文章
- 8.算法竞赛中的常用JAVA API :Calendar日期类
8.算法竞赛中的常用JAVA API :Calendar日期类 摘要 在蓝桥杯中有关于日期计算的问题,正好java中的Date类和Calendar类提供了对日期处理的一些方法.Date类大部分方法已经 ...
- 算法竞赛中的常用JAVA API :大数类(转载)
5.算法竞赛中的常用JAVA API :大数类 摘要 java中的基础数据类型能存储的最大的二进制数是 2 ^ 63 - 1 对应的十进制数是9223372036854775807(long类型的最大 ...
- 算法竞赛中的常用JAVA API:PriorityQueue(优先队列)(转载)
算法竞赛中的常用JAVA API:PriorityQueue(优先队列) PriorityQueue 翻译过来就是优先队列,本质是一个堆, 默认情况下堆顶每次都保留最小值,每插入一个元素,仍动态维护堆 ...
- 算法竞赛中的常用JAVA API :HashSet 和 TreeSet(转载)
算法竞赛中的常用JAVA API :HashSet 和 TreeSet set set容器的特点是不包含重复元素,也就是说自动去重. HashSet HashSet基于哈希表实现,无序. add(E ...
- 算法竞赛中的常用JAVA API :HashMap 和 TreeMap(转载)
算法竞赛中的常用JAVA API :HashMap 和 TreeMap 摘要 本文主要介绍Map接口下的HashMap和TreeMap. HashMap HashMap是基于哈希表的 Map 接口的实 ...
- 7.算法竞赛中的常用JAVA API :String 、StringBuilder、StringBuffer常用方法和区别(转载)
7.算法竞赛中的常用JAVA API :String .StringBuilder.StringBuffer常用方法和区别 摘要 本文将介绍String.StringBuilder类的常用方法. 在j ...
- 6.算法竞赛中的常用JAVA API :Math类(转载)
6.算法竞赛中的常用JAVA API :Math类 求最值 最小值 Math.min(int a, int b) Math.min(float a, float b) Math.min(double ...
- Java-杂项-java.nio:java.nio
ylbtech-Java-杂项-java.nio:java.nio java.nio全称java non-blocking IO,是指jdk1.4 及以上版本里提供的新api(New IO) ,为所有 ...
- java面试:java基础、Io、容器
1.java基础 1.JDK 和JRE有什么区别 JDK:java开发工具包,java开发运行环境.包含了JRE. JRE:java运行环境,包含java虚拟机,java基础类库. 2.jav ...
- Java基础:Java的四种引用
在Java基础:java虚拟机(JVM)中,我们提到了Java的四种引用.包括:强引用,软引用,弱引用,虚引用.这篇博客将详细的讲解一下这四种引用. 1. 强引用 2. 软引用 3. 弱引用 4. 虚 ...
随机推荐
- Go Redis 开发
redigo库来实现redis的操作:https://github.com/gomodule/redigo Redis常用操作 示例代码: package main import ( "gi ...
- ubuntu中如何添加IP
编辑网卡配置文件vi /etc/network/interfaces 在配置文件下增加新的IP配置 之后重启网络/etc/init.d/networking restart
- Centos6.5下Hbase安装
下载 http://mirror.bit.edu.cn/apache/hbase/hbase-0.94.26/hbase-0.94.26.tar.gz 2. 解压 tar -zxvf hbase-0 ...
- easyui,datagrid 分页,跨域访问数据
http://blog.itpub.net/30980622/viewspace-2051035/ 思路: 1.通过配置属性,loader加载跨域资源 2.获得$(pager).pagination对 ...
- MapReduce-shuffle过程详解
Shuffle map端 map函数开始产生输出时,并不是简单地将它写到磁盘.这个过程很复杂,它利用缓冲的方式写到内存并出于效率的考虑进行预排序.每个map任务都有一个环形内存缓冲区用于存储任务输出. ...
- POJ 1635 Subway tree systems (树的最小表示法)
题意:一串01序列,从一个点开始,0表示去下一个点,1表示回到上一个点,最后回到起点,遍历这棵树时每条边当且仅当走2次(来回) 给出两串序列,判断是否是同一棵树的不同遍历方式 题解:我们把每一个节点下 ...
- Python3一些包的下载
首先在windows的Python扩展包网址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 这里举例下载opencv3.2.0的安装包 我的电脑是win10,6 ...
- 隔行换色(WPF DataGrid 标准例子)
<DataGrid AlternationCount="2"> <DataGrid.RowStyle> ...
- Redis 存储机制
Redis存储机制分成两种Snapshot和AOF.无论是那种机制,Redis都是将数据存储在内存中. Snapshot工作原理: 是将数据先存储在内存,然后当数据累计达到某些设定的伐值的时候,就会触 ...
- OpenStack H版与 Ceph 整合的现状
转自:https://www.ustack.com/blog/openstack_and_ceph/ Contents 1 Ceph与Nova整合 2 Ceph与Cinder整合 3 相关Patch ...
