Class CIMDateTimeAbsolute
java.lang.Object
javax.cim.CIMDateTime
javax.cim.CIMDateTimeAbsolute
- All Implemented Interfaces:
Serializable, Comparable<CIMDateTime>
This class represents the datetime data type when used as a time value as
specified in the CIM Infrastructure specification. It is in the format
yyyyMMddHHmmss.SSSSSSsutc where:
- yyyy - is a 4 digit year
- MM - is the month
- dd - is the day of the month
- HH - is the hour (24 hour clock)
- mm - is the minute
- ss - is the second
- SSSSSS - is the number of microseconds
- s - is "+" or "-", indicating the sign of the UTC (Universal Coordinated Time; for all intents and purposes the same as Greenwich Mean Time)
- utc - is the offset from UTC in minutes (using the sign indicated by s).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreate aCIMDateTimeAbsolute
object using the current Time/Date of the system.CIMDateTimeAbsolute
(String pDateTime) Creates aCIMDateTimeAbsolute
object using a string.CIMDateTimeAbsolute
(Calendar pCalendar) Create aCIMDateTimeAbsolute
object using aCalendar
object. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(CIMDateTime pDateTime) Compares theCIMDateTimeAbsolute
object with this one.Gets the internal string representation of the date/time object.int
getDay()
Returns day value of this date.int
getHour()
Returns hour value of this date.int
Returns microsecond value of this date.int
Returns minute value of this date.int
getMonth()
Returns month value of this date.int
Returns second value of this date.int
Returns UTC offset value of this date.int
getYear()
Returns year value of this Date.int
hashCode()
Returns the hash code for this object.toString()
Returns aString
representation of theCIMDateTimeAbsolute
.Methods inherited from class CIMDateTime
equals
-
Constructor Details
-
CIMDateTimeAbsolute
public CIMDateTimeAbsolute()Create aCIMDateTimeAbsolute
object using the current Time/Date of the system. -
CIMDateTimeAbsolute
Create aCIMDateTimeAbsolute
object using aCalendar
object.- Parameters:
pCalendar
- ACalendar
object used to initialize this object.- Throws:
IllegalArgumentException
- IfCalendar
object isnull
.
-
CIMDateTimeAbsolute
Creates aCIMDateTimeAbsolute
object using a string.- Parameters:
pDateTime
- A string in the format of yyyyMMddHHmmss.SSSSSSsutc.- Throws:
IllegalArgumentException
- If string is not in the correct format ornull
.
-
-
Method Details
-
compareTo
Compares theCIMDateTimeAbsolute
object with this one. If either date has "Not Significant" fields then we can only compare the significant fields.- Parameters:
pDateTime
- TheCIMDateTimeAbsolute
to be compared with this one.- Returns:
- -1, zero, or 1 as this date is less than, equal to, or greater than the specified date.
- Throws:
IllegalArgumentException
- If the object passed in is not an instance ofCIMDataTimeAbsolute
.
-
getDateTimeString
Gets the internal string representation of the date/time object.- Specified by:
getDateTimeString
in classCIMDateTime
- Returns:
- The internal representation of the date/time object.
-
getDay
public int getDay()Returns day value of this date.- Returns:
- If day field "not significant" this returns -1, otherwise returns day of this date.
-
getHour
public int getHour()Returns hour value of this date.- Returns:
- If hour field "not significant" this returns -1, otherwise returns hour of this date.
-
getMicrosecond
public int getMicrosecond()Returns microsecond value of this date.- Returns:
- If microsecond field "not significant" this returns -1, otherwise returns microseconds of this date.
-
getMinute
public int getMinute()Returns minute value of this date.- Returns:
- If minute field "not significant" this returns -1, otherwise returns minute of this date.
-
getMonth
public int getMonth()Returns month value of this date.- Returns:
- If month field "not significant" this returns -1, otherwise returns the month of this date.
-
getSecond
public int getSecond()Returns second value of this date.- Returns:
- If second field "not significant" this returns -1, otherwise returns second of this date.
-
getUTCOffset
public int getUTCOffset()Returns UTC offset value of this date.- Returns:
- UTC offset of this date.
-
getYear
public int getYear()Returns year value of this Date.- Returns:
- If year field "not significant" this returns -1, otherwise returns the year of this date.
-
hashCode
public int hashCode()Returns the hash code for this object.- Specified by:
hashCode
in classCIMDateTime
- Returns:
- A hash code value for this object.
- See Also:
-
toString
Returns aString
representation of theCIMDateTimeAbsolute
. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not benull
.
-