标签:pac 需要 对象 接受 before class padding pad add
在类 Date 所有可以接受或返回年、月、日期、小时、分钟和秒值的方法中,将使用下面的表示形式:
- 1900 表示。在所有情形中,针对这些目的赋予方法的参数不需要在指定的范围内;例如,可以把日期指定为 1 月 32 日,并把它解释为 2 月 1 日的相同含义。
| 过时方法摘要 |
|---|
int |
|
int |
getDate()已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.DAY_OF_MONTH) 取代。 |
int |
getDay()已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.DAY_OF_WEEK) 取代。 |
int |
getHours()已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.HOUR_OF_DAY) 取代。 |
int |
getMinutes()已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.MINUTE) 取代。 |
int |
getMonth()
已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.MONTH) 取代。 |
int |
getSeconds()已过时。 从 JDK 1.1 开始,由 Calendar.get(Calendar.SECOND) 取代。 |
常用方法
public long getTime()
public void setTime(long time)
Date 对象,以表示 1970 年 1 月 1 日 00:00:00 GMT 以后 time 毫秒的时间点。 time - 毫秒数。
public boolean before(Date when)
when - 日期。true;否则返回 false。NullPointerException - 如果 when 为 null。
public boolean after(Date when)
when - 日期。true;否则返回 false。NullPointerException - 如果 when 为 null。
public String toString()
Date 对象转换为以下形式的 String:
其中:dow mon dd hh:mm:ss zzz yyyy
标签:pac 需要 对象 接受 before class padding pad add
原文地址:http://www.cnblogs.com/maokun/p/6718255.html