java.util
Class Date
java.lang.Object
|
+--java.util.Date
- All Implemented Interfaces:
- Cloneable, Comparable, java.io.Serializable
- public synchronized class Date
- extends Object
- implements java.io.Serializable, Cloneable, Comparable
Constructor Summary |
Date()
|
Date(int,
int,
int)
|
Date(int,
int,
int,
int,
int)
|
Date(int,
int,
int,
int,
int,
int)
|
Date(long)
|
Date(String)
|
Date
public Date()
Date
public Date(long)
Date
public Date(int,
int,
int)
Date
public Date(int,
int,
int,
int,
int)
Date
public Date(int,
int,
int,
int,
int,
int)
Date
public Date(String)
clone
public Object clone()
UTC
public static long UTC(int,
int,
int,
int,
int,
int)
parse
public static long parse(String)
getYear
public int getYear()
setYear
public void setYear(int)
getMonth
public int getMonth()
setMonth
public void setMonth(int)
getDate
public int getDate()
setDate
public void setDate(int)
getDay
public int getDay()
getHours
public int getHours()
setHours
public void setHours(int)
getMinutes
public int getMinutes()
setMinutes
public void setMinutes(int)
getSeconds
public int getSeconds()
setSeconds
public void setSeconds(int)
getTime
public long getTime()
setTime
public void setTime(long)
before
public boolean before(Date)
after
public boolean after(Date)
equals
public boolean equals(Object)
- Description copied from class:
Object
- Determines if this object is "equal" to another object.
In general, objects should be instances of the same class
with the same guts to be considered equal. For example,
the code below only prints same value since
s
and t
are different strings though
they have the same value: "hello".
String s = new String("hello");
String t = new String("hello");
if (s.equals(t)) System.out.println("same value");
if (s == t) System.out.println("same string");
- Overrides:
equals
in class Object
- Following copied from class:
java.lang.Object
- Parameters:
is
- the other Object to which this one is compared- Returns:
- true if this Object is equal to
other
compareTo
public int compareTo(Date)
compareTo
public int compareTo(Object)
- Specified by:
compareTo
in interface Comparable
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
toLocaleString
public String toLocaleString()
toGMTString
public String toGMTString()
getTimezoneOffset
public int getTimezoneOffset()