|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Date
com.silverpeas.calendar.AbstractDateDatable<DateTime>
com.silverpeas.calendar.DateTime
public class DateTime
A date and time.
Field Summary |
---|
Fields inherited from interface com.silverpeas.calendar.Datable |
---|
ICAL_PATTERN, ICAL_UTC_PATTERN, ISO_8601_PATTERN, SHORT_ISO_8601_PATTERN |
Constructor Summary | |
---|---|
DateTime(Date aDate)
Constructs a new date time from the specified Java date and with the host time zone as time zone. |
|
DateTime(Date aDate,
TimeZone timeZone)
Constructs a new date time from the specified Java date and in the specified time zone. |
Method Summary | |
---|---|
Date |
asDate()
Gets the java Date representation of this datable. |
DateTime |
clone()
Clones itself. |
static DateTime |
dateTimeAt(int... timeParts)
Creates a new date time from the specified parts of the time specification year month day hour minute second millisecond. |
boolean |
equals(Object obj)
|
TimeZone |
getTimeZone()
Gets the time zone for which this datable is defined. |
int |
hashCode()
|
DateTime |
inTimeZone(TimeZone timeZone)
Sets the time zone this datable is defined for. |
boolean |
isAfter(Date otherDate)
Is the date in this datetime after the specified date. |
boolean |
isAfter(DateTime anotherDatable)
Is this datable strictly after in time the specified another one? |
boolean |
isBefore(Date otherDate)
Is the date in this datetime before the specified date. |
boolean |
isBefore(DateTime anotherDatable)
Is this datable strictly before in time the specified another one? |
boolean |
isEqualTo(Date otherDate)
Is the date in this datetime equal to the specified date. |
boolean |
isEqualTo(DateTime anotherDatable)
Is this datable equal in time to the specified another one? |
protected DateTime |
newInstanceFrom(Date aDate)
Create a new instance from a given date time in milliseconds. |
static DateTime |
now()
Creates a new date time set at now. |
Date |
toDate()
Converts this date time to a date. |
String |
toICal()
Gets the ISO 8601 textual representation of this date as it is in the iCal specification. |
String |
toICalInUTC()
Gets the ISO 8601 textual representation of this date as it is in the iCal specification. |
String |
toISO8601()
Gets an ISO 8601 textual representation of this datable by taking into account of its underlying timezone. |
String |
toShortISO8601()
Gets an ISO 8601 textual representation of this datable by taking into account of its underlying timezone. |
Methods inherited from class com.silverpeas.calendar.AbstractDateDatable |
---|
addDays, addHours, addMilliseconds, addMinutes, addMonths, addSeconds, addWeeks, addYears, getBeginOfDay, getBeginOfMonth, getBeginOfWeek, getBeginOfWeek, getBeginOfYear, getEndOfDay, getEndOfMonth, getEndOfWeek, getEndOfWeek, getEndOfYear, getTimeDataTo, isDefined, isNotDefined |
Methods inherited from class java.util.Date |
---|
after, before, compareTo, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toLocaleString, toString, UTC |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DateTime(Date aDate)
aDate
- the Java date from which a date time is built.public DateTime(Date aDate, TimeZone timeZone)
aDate
- the Java date from which a date time is built.timeZone
- the time zone in which this date is set.Method Detail |
---|
public static DateTime now()
public static DateTime dateTimeAt(int... timeParts)
timeParts
- the different parts of the date time to set in the following order: year,
month, day, hour, minute, second, millisecond. The year, month, and day are mandatory whereas
other time parts are optional. If one optional part isn't passed, then it is set to 0.
protected DateTime newInstanceFrom(Date aDate)
AbstractDateDatable
newInstanceFrom
in class AbstractDateDatable<DateTime>
aDate
- the date time in milliseconds.
public DateTime clone()
Datable
clone
in interface Datable<DateTime>
clone
in class AbstractDateDatable<DateTime>
public Date asDate()
Datable
public String toISO8601()
Datable
public String toShortISO8601()
Datable
public String toICal()
Datable
public String toICalInUTC()
Datable
public DateTime inTimeZone(TimeZone timeZone)
Datable
timeZone
- the time zone of this datable.
public TimeZone getTimeZone()
Datable
public boolean isBefore(DateTime anotherDatable)
Datable
anotherDatable
- the another datable to which this is compared.
public boolean isAfter(DateTime anotherDatable)
Datable
anotherDatable
- the another datable to which this is compared.
public boolean isEqualTo(DateTime anotherDatable)
Datable
anotherDatable
- the another datable to which this is compared.
public boolean equals(Object obj)
equals
in class Date
public int hashCode()
hashCode
in class Date
public boolean isBefore(Date otherDate)
otherDate
- the other date.
public boolean isAfter(Date otherDate)
otherDate
- the other date.
public boolean isEqualTo(Date otherDate)
otherDate
- the other date.
public Date toDate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |