public class IlrDateTime extends IlrTimeZone
http://www.w3.org/TR/xmlschema-2/#dateTime).EQUAL, GREATER, LOWER| Constructor and Description |
|---|
IlrDateTime()
Builds a
dateTime structure without any time zone. |
IlrDateTime(java.util.Date date)
Build an instance from a date without any time zone.
|
IlrDateTime(java.util.Date date,
java.util.TimeZone timeZone)
Build an instance from a date and a time zone information.
|
IlrDateTime(long l)
Builds an
IlrDateTime from a long. |
IlrDateTime(java.lang.String str)
Build an instance from a string.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IlrDateTime date)
Compares two
dateTimes. |
boolean |
equals(java.lang.Object obj) |
short |
getCentury()
Get the century.
|
short |
getDay()
Get the day.
|
java.lang.String |
getFractionalSecond()
Get the remaining fractional second.
|
short |
getHour()
Get the hour.
|
short |
getMillisecond()
Get the remaining millisecond.
|
short |
getMinute()
Get the minute.
|
short |
getMonth()
Get the month of the date.
|
short |
getSecond()
Get the second.
|
short |
getYear()
Get the year.
|
boolean |
isEqual(IlrDateTime dt)
Determines if two
dateTime objects are equal. |
boolean |
isPositive()
Determines if the
dateTime is positive. |
static IlrDateTime |
parse(java.lang.String str)
Create an
IlrDateTime from a string. |
void |
set(java.util.Date date)
Set an instance from a date without time zone support.
|
void |
set(java.util.Date date,
java.util.TimeZone timeZone)
Set an instance from a date and a time zone.
|
void |
setDate(short century,
short year,
short month,
short day)
Sets the date part of an instance as century/year/month/day/.
|
void |
setPositive(boolean positive)
Sets as a positive
dateTime. |
void |
setTime(short hour,
short minute,
short second,
short millisecond)
Sets the time part of a
dateTime as
hour/minute/second/millisecond. |
java.util.Date |
toDate()
Converts the
dateTime to a date instance. |
java.lang.String |
toString() |
static IlrDateTime |
valueOf(java.lang.String str)
Create an
IlrDateTime from a string. |
formatToString, formatToString, getTimeZoneInMillis, getZoneHour, getZoneMinute, isEqual, isUTC, isZonePositive, setTimeZone, setTimeZoneInMillis, setUTC, toTimeZone, unsetUTCpublic IlrDateTime()
dateTime structure without any time zone.public IlrDateTime(long l)
IlrDateTime from a long.l - The long parameterpublic IlrDateTime(java.util.Date date)
public IlrDateTime(java.util.Date date,
java.util.TimeZone timeZone)
public IlrDateTime(java.lang.String str)
throws IlrDateFormatException
IlrDateFormatException - raised when the string format is invalid.public void set(java.util.Date date)
public void set(java.util.Date date,
java.util.TimeZone timeZone)
public void setPositive(boolean positive)
dateTime.public void setDate(short century,
short year,
short month,
short day)
public void setTime(short hour,
short minute,
short second,
short millisecond)
dateTime as
hour/minute/second/millisecond. All the fields must be positive.public boolean isPositive()
dateTime is positive.public short getCentury()
public short getYear()
public short getMonth()
public short getDay()
public short getHour()
public short getMinute()
public short getSecond()
public short getMillisecond()
public java.lang.String getFractionalSecond()
public java.util.Date toDate()
throws IlrDateFormatException
dateTime to a date instance.IlrDateFormatExceptionpublic java.lang.String toString()
toString in class IlrTimeZonepublic boolean isEqual(IlrDateTime dt)
dateTime objects are equal. Note that this
comparison is not compliant with the W3C specification. It is equivalent
to converting the IlrDateTime to Date and
comparing them.public boolean equals(java.lang.Object obj)
equals in class IlrTimeZonepublic int compareTo(IlrDateTime date)
dateTimes. Note that this comparison is not
compliant with the W3C specification.public static IlrDateTime parse(java.lang.String str) throws IlrDateFormatException
IlrDateTime from a string.IlrDateFormatException - when the format is not valid.public static IlrDateTime valueOf(java.lang.String str)
IlrDateTime from a string.IlrDateFormatException - when the format is not valid.© Copyright IBM Corp. 1987, 2017