java.util.Date (JDK 1.0)
This class represents dates and times. It lets you work with them in a system-independent way. You can create a Date by specifying the number of milliseconds from the epoch (midnight GMT, January 1st, 1970), or by specifying the year, month, date, and optionally, the hour, minute, and second. Years are specified as the number of years since 1900. If you call the Date constructor with no arguments, the Date is initialized to the current time and date. The instance methods of the class allow you to get and set the various date and time fields, to compare dates and times, and to convert dates to and from string representations.
In Java 1.1, many of the date methods have been deprecated in favor of the methods of the Calendar class.
public classDateextends Object implements Serializable, Cloneable { //Public ConstructorspublicDate(); publicDate(longdate); # publicDate(intyear, intmonth, intdate); # publicDate(intyear, intmonth, intdate, inthrs, intmin); # publicDate(intyear, intmonth, intdate, inthrs, intmin, intsec); # publicDate(Strings); //Class Methods# public static longUTC(intyear, intmonth, intdate, inthrs, intmin, intsec); # public static longparse(Strings); //Public Instance Methodspublic booleanafter(Datewhen); public booleanbefore(Datewhen); public booleanequals(Objectobj); //Overrides Object# public intgetDate(); # public intgetDay(); # public intgetHours(); # public intgetMinutes(); # public intgetMonth(); # public intgetSeconds(); public longgetTime(); # public intgetTimezoneOffset(); # public intgetYear(); public inthashCode(); //Overrides Object# public voidsetDate(intdate); # public voidsetHours(inthours); # public voidsetMinutes(intminutes); # public voidsetMonth(intmonth); # public voidsetSeconds(intseconds); public voidsetTime(longtime); # public voidsetYear(intyear); # public StringtoGMTString(); # public StringtoLocaleString(); public StringtoString(); //Overrides Object}
Passed To:
Calendar.setTime(), Date.after(), Date.before(), DateFormat.format(), GregorianCalendar.setGregorianChange(), SimpleDateFormat.format(), SimpleTimeZone.inDaylightTime(), TimeZone.inDaylightTime()
Returned By:
Calendar.getTime(), DateFormat.parse(), GregorianCalendar.getGregorianChange(), SimpleDateFormat.parse()