version 1.35, 2003/10/22 14:26:02
|
version 1.36, 2003/10/27 19:48:06
|
|
|
/** | /** |
The CIMDateTime class represents the CIM datetime data type as a C++ class | The CIMDateTime class represents the CIM datetime data type as a C++ class |
CIMDateTime. A CIM datetime may contain a date or an interval. CIMDateTime | CIMDateTime. A CIM datetime may contain a date or an interval. CIMDateTime |
is an intrinsic CIM data type which represents the time as a formatted |
is an intrinsic CIM data type that represents the time as a string with a |
fixed length string. |
fixed length. |
| |
<PRE> | <PRE> |
A date has the following form: | A date has the following form: |
|
|
mm = minute (0-59) | mm = minute (0-59) |
ss = second (0-59) | ss = second (0-59) |
mmmmmm = microseconds | mmmmmm = microseconds |
s = '+' or '-' to represent the UTC sign |
s = '+' or '-' to represent the Coordinated Universal Time (UTC) sign |
utc = UTC offset (same as GMT offset) |
utc = offset from Coordinated Universal Time (UTC) |
|
(same as Greenwich Mean Time(GMT) offset) |
| |
An interval has the following form: | An interval has the following form: |
| |
|
|
mmmmmm = microseconds | mmmmmm = microseconds |
</PRE> | </PRE> |
| |
Note that intervals always end in ":000" (this is how they |
Note: Intervals always end in ":000". This distinguishes intervals from dates. |
are distinguished from dates). |
|
| |
CIMDateTime objects are constructed from String objects or from | CIMDateTime objects are constructed from String objects or from |
other CIMDateTime objects. These character strings must be exactly |
other CIMDateTime objects. Character strings must be exactly |
twenty-five characters and conform to one of the forms identified |
twenty-five characters in length and conform to either the date or interval |
above. |
format. |
| |
CIMDateTime objects that are not explicitly initialized will be | CIMDateTime objects that are not explicitly initialized will be |
implicitly initialized with a zero time interval: | implicitly initialized with a zero time interval: |
|
|
See the class documentation for CIMDateTime for the definition of the | See the class documentation for CIMDateTime for the definition of the |
input string for absolute and interval datetime. | input string for absolute and interval datetime. |
@param str String object containing the CIM DateTime-formatted string. | @param str String object containing the CIM DateTime-formatted string. |
|
This must contain twenty-five characters. |
*/ | */ |
CIMDateTime(const String & str); | CIMDateTime(const String & str); |
| |
/** Creates a CIMDateTime object from another CIMDateTime object. | /** Creates a CIMDateTime object from another CIMDateTime object. |
@param x CIMDateTime object to be copied. |
@param x Specifies the name of the CIMDateTime object to copy. |
*/ | */ |
CIMDateTime(const CIMDateTime& x); | CIMDateTime(const CIMDateTime& x); |
| |
/** CIMDateTime Destructor. */ |
/** CIMDateTime destructor. */ |
~CIMDateTime(); | ~CIMDateTime(); |
| |
/** Assign one CIMDateTime object to another. |
/** Assigns one instance of the CIMDateTime object to another. |
@param x The CIMDateTime Object to assign. |
@param x The CIMDateTime Object to assign to the CIMDateTime object. |
|
For example, you can assign the d1 CIMDateTime instance to the d2 |
|
CIMDateTime instance. |
<PRE> | <PRE> |
CIMDateTime d1; | CIMDateTime d1; |
CIMDateTime d2 = "00000000000000.000000:000"; | CIMDateTime d2 = "00000000000000.000000:000"; |
d1 = d1; |
d1 = d2; |
</PRE> | </PRE> |
|
Therefore, d1 is assigned the same "00000000000000.000000:000" value as d2. |
*/ | */ |
CIMDateTime& operator=(const CIMDateTime& x); | CIMDateTime& operator=(const CIMDateTime& x); |
| |
/** Returns a string representing the DateTime value of the | /** Returns a string representing the DateTime value of the |
CIMDateTime Object. |
CIMDateTime object. |
@return String representing the DateTime value. | @return String representing the DateTime value. |
*/ | */ |
String toString () const; | String toString () const; |
| |
/** Sets the date time in the CIMDateTime object from |
/** Sets the date and time in the CIMDateTime object from |
the input parameter. | the input parameter. |
@param str String constant containing the datetime | @param str String constant containing the datetime |
in the datetime format. |
in the datetime format. This must conform the to formatting rules specified |
|
in the CIMDateTime class description. For example, the following sets |
|
the date to December 24, 1999 and time to 12:00 P.M. |
| |
<PRE> | <PRE> |
CIMDateTime dt; | CIMDateTime dt; |
dt.set("19991224120000.000000+360"); | dt.set("19991224120000.000000+360"); |
</PRE> | </PRE> |
| |
@exception InvalidDateTimeFormatException on format error. |
@exception InvalidDateTimeFormatException because the date and time is not |
|
formatted correctly. See the CIMDateTime class decscription for the |
|
formatting rules. |
*/ | */ |
void set(const String & str); | void set(const String & str); |
| |
|
|
*/ | */ |
void clear(); | void clear(); |
| |
/** Get current time as CIMDateTime. The time returned is the local time. |
/** Receives the current time as CIMDateTime. The time is returned as the local time. |
@return CIMDateTime object containing the current datetime. |
@return CIMDateTime object containing the current date and time. |
*/ | */ |
static CIMDateTime getCurrentDateTime(); | static CIMDateTime getCurrentDateTime(); |
| |
|
|
two CIMDateTime intervals. | two CIMDateTime intervals. |
@param startTime Contains the start datetime. | @param startTime Contains the start datetime. |
@param finishTime Contains the finish datetime. | @param finishTime Contains the finish datetime. |
@return Interger containing the difference between the two datetimes |
@return Integer that contains the difference between the two datetime values |
in microseconds. | in microseconds. |
@exception InvalidDateTimeFormatException If one argument is a datetime |
@exception InvalidDateTimeFormatException If one argument uses the interval |
and one is an interval. |
format and the other uses the string format. |
@exception DateTimeOutOfRangeException If datetime is outside the allowed | @exception DateTimeOutOfRangeException If datetime is outside the allowed |
range. | range. |
| |
NOTE: The behavior on HP-UX and Windows platform is to throw an exception |
Note: The behavior on HP-UX and Windows platform is to throw an exception |
when the dates are out of range. Red Hat Linux platform normalizes the | when the dates are out of range. Red Hat Linux platform normalizes the |
dates when they are outside their legal interval and will not throw an | dates when they are outside their legal interval and will not throw an |
exception. | exception. |
|
|
| |
On Windows platform, the approximate range is between 1970 to 2038. | On Windows platform, the approximate range is between 1970 to 2038. |
| |
On Red Hat Linux the approximate range of dates allowed are within the |
On Red Hat Linux platform the approximate range is between 1901 and 2038. |
range of 1901 and 2038. |
|
*/ | */ |
static Sint64 getDifference(CIMDateTime startTime, CIMDateTime finishTime); | static Sint64 getDifference(CIMDateTime startTime, CIMDateTime finishTime); |
| |
/** Checks whether the datetime is an interval. | /** Checks whether the datetime is an interval. |
@return true if the datetime is an interval, false otherwise. |
@return True if the datetime is an interval; otherwise, false. |
*/ | */ |
Boolean isInterval(); | Boolean isInterval(); |
| |
/** Compares the CIMDateTime object to another CIMDateTime object for | /** Compares the CIMDateTime object to another CIMDateTime object for |
equality. | equality. |
@param x CIMDateTime object to be compared. | @param x CIMDateTime object to be compared. |
@return true if the two CIMDateTime objects are equal, false otherwise. |
@return true if the two CIMDateTime objects are equal; otherwise, false. |
*/ | */ |
Boolean equal (const CIMDateTime & x) const; | Boolean equal (const CIMDateTime & x) const; |
| |
private: | private: |
| |
CIMDateTimeRep* _rep; | CIMDateTimeRep* _rep; |
|
|
Boolean _set(const String & dateTimeStr); | Boolean _set(const String & dateTimeStr); |
}; | }; |
|
/** |
|
Add documentation here. |
|
*/ |
PEGASUS_COMMON_LINKAGE Boolean operator==( | PEGASUS_COMMON_LINKAGE Boolean operator==( |
|
/** |
|
Add documentation here. |
|
*/ |
const CIMDateTime& x, | const CIMDateTime& x, |
|
/** |
|
Add documentation here. |
|
*/ |
const CIMDateTime& y); | const CIMDateTime& y); |
| |
#define PEGASUS_ARRAY_T CIMDateTime | #define PEGASUS_ARRAY_T CIMDateTime |