public class DateTime extends Date
| Constructor and Description |
|---|
DateTime()
Default constructor.
|
DateTime(boolean utc) |
DateTime(java.util.Date date) |
DateTime(long time) |
DateTime(java.lang.String value)
Constructs a new DateTime instance from parsing the specified string representation in the default (local)
timezone.
|
DateTime(java.lang.String value,
TimeZone timezone)
Creates a new date-time instance from the specified value in the given timezone.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object arg0)
Uses
EqualsBuilder to test equality. |
TimeZone |
getTimeZone()
Returns the current timezone associated with this date-time value.
|
int |
hashCode()
Uses
HashCodeBuilder to build hashcode. |
boolean |
isUtc() |
void |
setTime(long time) |
void |
setTimeZone(TimeZone timezone)
Sets the timezone associated with this date-time instance.
|
void |
setUtc(boolean utc)
Updates this date-time to display in UTC time if the argument is true.
|
java.lang.String |
toString() |
public DateTime()
public DateTime(boolean utc)
utc - public DateTime(long time)
time - public DateTime(java.util.Date date)
date - public DateTime(java.lang.String value)
throws java.text.ParseException
value - java.text.ParseExceptionpublic DateTime(java.lang.String value,
TimeZone timezone)
throws java.text.ParseException
TimeZone.getDefault()) is used.value - java.text.ParseExceptionpublic final boolean isUtc()
public final void setUtc(boolean utc)
utc - The utc to set.public final void setTimeZone(TimeZone timezone)
timezone - public final TimeZone getTimeZone()
public boolean equals(java.lang.Object arg0)
EqualsBuilder to test equality.equals in class java.util.Datepublic int hashCode()
HashCodeBuilder to build hashcode.hashCode in class java.util.Date