|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.util.Date
public final class Date
An SDK implementation of Date which closely mirrors java.util.GregorianCalendar but only supports day, month and year Note that, unlike the Microsoft.NET System.DateTime, the values for Month range from 0 (January) to 11 (December) This is in keeping with java.util.Date and java.util.GregorianCalendar
| Field Summary | |
|---|---|
static int |
DATE_VALUE_NOT_SET
Constant used in some properties to indicate this date value has not been set. |
static Date |
MAX_VALUE
11:59:59 P.M., December 31, 4636 A.D. |
static Date |
MIN_VALUE
Jan 1, 1900 AD 12:00:00 |
static Date |
VALUE_NOT_SET
Date used in some properties to indicate this date value has not been set. |
| Constructor Summary | |
|---|---|
Date()
Creates a new Date using current time in GMT. |
|
Date(int year,
int month,
int dayOfMonth)
Create a new Date from a Year, Month and DayOfMonth |
|
Date(java.lang.String s)
Constructs a Date from a string specified in the standard SQL format i.e. |
|
| Method Summary | |
|---|---|
Date |
addDays(int nDays)
Returns a new Date that is nDays after this one. |
int |
compareTo(Date date)
Returns: > 0 if this date is after the given date; 0 if this date is the same as the given date; < 0 if this date is before the given date. |
int |
diffInDays(Date other)
Subtracts a date from this one, returning the difference in days. |
boolean |
equals(java.lang.Object other)
returns true if the content of this Date Object is equal to the specified other instance false if its not, or if the other object is not a Date instance |
int |
getDayOfMonth()
returns the day of month (a valid integer between 1 and 31) |
java.lang.String |
getDebugString()
a string representation of the content of this object instance generally useful for debugging |
static TimeSpan |
getElapsedTime(Date before,
Date after)
Returns the elapsed time between two Date instances. |
int |
getMonth()
returns the month (an integer between 0 and 11) |
int |
getYear()
returns the year (an integer between 1900 and 9999) |
int |
hashCode()
Returns a hashCode value for the object. |
boolean |
isAfter(Date date)
Returns true if the given date is after this one in time |
boolean |
isBefore(Date date)
Returns true if the given date is before this one in time |
boolean |
isEqualTo(Date date)
Returns true if the given date is the same as this one |
DateTime |
toDateTime()
returns a DateTime instance of this date centered at UTC noon |
static Date |
today()
returns the Date value of today using current time in GMT |
java.lang.String |
toLocalString(int dateFormat)
returns a String representation of this Date instance formatted for the default locale |
java.lang.String |
toSQLString()
Returns the date in the standard 'SQL' format, i.e. |
java.lang.String |
toString()
Returns the date in the standard 'SQL' format, i.e. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Date MIN_VALUE
public static final Date MAX_VALUE
public static final int DATE_VALUE_NOT_SET
public static final Date VALUE_NOT_SET
| Constructor Detail |
|---|
public Date(int year,
int month,
int dayOfMonth)
year - 1900 - 9999month - 0 - 11dayOfMonth - 1 - 31public Date()
public Date(java.lang.String s)
s - a string specified in the standard SQL format| Method Detail |
|---|
public static Date today()
public int getDayOfMonth()
public int getMonth()
public int getYear()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toSQLString()
public java.lang.String toLocalString(int dateFormat)
dateFormat - a date format descriptor
public java.lang.String getDebugString()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - - the other Date instance
public int hashCode()
hashCode in class java.lang.Objectpublic Date addDays(int nDays)
nDays - - the number of days to add
public int diffInDays(Date other)
other - - the Date instance to subtract from this one
public boolean isBefore(Date date)
date - - the Date instance to compare with this one
public boolean isAfter(Date date)
date - - the Date instance to compare with this one
public boolean isEqualTo(Date date)
date - - the Date instance to compare with this one
public int compareTo(Date date)
date - - the Date instance to compare with this one
public DateTime toDateTime()
public static TimeSpan getElapsedTime(Date before,
Date after)
before - Dateafter - Date
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||