|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Date
public class Date
Date represents a specific moment in time, to the millisecond.
System.currentTimeMillis(),
Calendar,
GregorianCalendar,
SimpleTimeZone,
TimeZone,
Serialized Form| Constructor Summary | |
|---|---|
Date()
Initializes this Date instance to the current date and time. |
|
Date(int year,
int month,
int day)
Deprecated. use GregorianCalendar.GregorianCalendar(int, int, int) |
|
Date(int year,
int month,
int day,
int hour,
int minute)
Deprecated. use GregorianCalendar.GregorianCalendar(int, int, int, int, int) |
|
Date(int year,
int month,
int day,
int hour,
int minute,
int second)
Deprecated. use GregorianCalendar.GregorianCalendar(int, int, int, int, int, int) |
|
Date(long milliseconds)
Initializes this Date instance using the specified millisecond value. |
|
Date(String string)
Deprecated. use DateFormat |
|
| Method Summary | |
|---|---|
boolean |
after(Date date)
Returns if this Date is after the specified Date. |
boolean |
before(Date date)
Boolean indication of whether or not this Date occurs
earlier than the Date argument. |
Object |
clone()
Returns a new Date with the same millisecond value as this Date. |
int |
compareTo(Date date)
Compare the receiver to the specified Date to determine the relative ordering. |
boolean |
equals(Object object)
Compares the specified object to this Date and answer if they are equal. |
int |
getDate()
Deprecated. use Calendar.get(Calendar.DATE) |
int |
getDay()
Deprecated. use Calendar.get(Calendar.DAY_OF_WEEK) |
int |
getHours()
Deprecated. use Calendar.get(Calendar.HOUR_OF_DAY) |
int |
getMinutes()
Deprecated. use Calendar.get(Calendar.MINUTE) |
int |
getMonth()
Deprecated. use Calendar.get(Calendar.MONTH) |
int |
getSeconds()
Deprecated. use Calendar.get(Calendar.SECOND) |
long |
getTime()
Returns this Date as a millisecond value. |
int |
getTimezoneOffset()
Deprecated. use (Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / 60000 |
int |
getYear()
Deprecated. use Calendar.get(Calendar.YEAR) - 1900 |
int |
hashCode()
Returns an integer hash code for the receiver. |
static long |
parse(String string)
Deprecated. use DateFormat |
void |
setDate(int day)
Deprecated. use Calendar.set(Calendar.DATE, day) |
void |
setHours(int hour)
Deprecated. use Calendar.set(Calendar.HOUR_OF_DAY, hour) |
void |
setMinutes(int minute)
Deprecated. use Calendar.set(Calendar.MINUTE, minute) |
void |
setMonth(int month)
Deprecated. use Calendar.set(Calendar.MONTH, month) |
void |
setSeconds(int second)
Deprecated. use Calendar.set(Calendar.SECOND, second) |
void |
setTime(long milliseconds)
Sets this Date to the specified millisecond value. |
void |
setYear(int year)
Deprecated. use Calendar.set(Calendar.YEAR, year + 1900) |
String |
toGMTString()
Deprecated. use DateFormat |
String |
toLocaleString()
Deprecated. use DateFormat |
String |
toString()
Returns the string representation of this Date in the format: Tue Jun 22 13:07:00 GMT 1999 |
static long |
UTC(int year,
int month,
int day,
int hour,
int minute,
int second)
Deprecated. use:
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
cal.set(year + 1900, month, day, hour, minute, second);
cal.getTime().getTime(); |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Date()
@Deprecated
public Date(int year,
int month,
int day)
GregorianCalendar.GregorianCalendar(int, int, int)
year - the year, 0 is 1900month - the month, 0 - 11day - the day of the month, 1 - 31
@Deprecated
public Date(int year,
int month,
int day,
int hour,
int minute)
GregorianCalendar.GregorianCalendar(int, int, int, int, int)
year - the year, 0 is 1900month - the month, 0 - 11day - the day of the month, 1 - 31hour - the hour of day, 0 - 23minute - the minute of the hour, 0 - 59
@Deprecated
public Date(int year,
int month,
int day,
int hour,
int minute,
int second)
GregorianCalendar.GregorianCalendar(int, int, int, int, int, int)
year - the year, 0 is 1900month - the month, 0 - 11day - the day of the month, 1 - 31hour - the hour of day, 0 - 23minute - the minute of the hour, 0 - 59second - the second of the minute, 0 - 59public Date(long milliseconds)
milliseconds - the number of milliseconds since Jan. 1, 1970 GMT@Deprecated public Date(String string)
DateFormat
string - the String to parse| Method Detail |
|---|
public boolean after(Date date)
date - a Date instance to compare
public boolean before(Date date)
Date occurs
earlier than the Date argument.
date - a Date instance to compare
true if this Date occurs earlier
than date, otherwise falsepublic Object clone()
clone in class ObjectCloneablepublic int compareTo(Date date)
compareTo in interface Comparable<Date>date - a Date
public boolean equals(Object object)
equals in class Objectobject - the object to compare with this object
hashCode()@Deprecated public int getDate()
@Deprecated public int getDay()
@Deprecated public int getHours()
@Deprecated public int getMinutes()
@Deprecated public int getMonth()
@Deprecated public int getSeconds()
public long getTime()
@Deprecated public int getTimezoneOffset()
(Calendar.get(Calendar.ZONE_OFFSET) + Calendar.get(Calendar.DST_OFFSET)) / 60000
@Deprecated public int getYear()
Calendar.get(Calendar.YEAR) - 1900
public int hashCode()
hashCode in class Objectequals(java.lang.Object)@Deprecated public static long parse(String string)
DateFormat
string - the String to parse
@Deprecated public void setDate(int day)
day - the day of the month@Deprecated public void setHours(int hour)
hour - the hour of the day@Deprecated public void setMinutes(int minute)
minute - the minutes@Deprecated public void setMonth(int month)
month - the month@Deprecated public void setSeconds(int second)
second - the secondspublic void setTime(long milliseconds)
milliseconds - the number of milliseconds since Jan. 1, 1970 GMT.@Deprecated public void setYear(int year)
year - the year since 1900@Deprecated public String toGMTString()
DateFormat
@Deprecated public String toLocaleString()
DateFormat
public String toString()
toString in class Object
@Deprecated
public static long UTC(int year,
int month,
int day,
int hour,
int minute,
int second)
Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
cal.set(year + 1900, month, day, hour, minute, second);
cal.getTime().getTime();
year - the year, 0 is 1900month - the month, 0 - 11day - the day of the month, 1 - 31hour - the hour of day, 0 - 23minute - the minute of the hour, 0 - 59second - the second of the minute, 0 - 59
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||