#include <OWBI1_CIMDateTime.hpp>
Collaboration diagram for OWBI1::CIMDateTime:
Public Types | |
typedef detail::CIMDateTimeRepRef CIMDateTime::* | safe_bool |
enum | EErrorCodes { E_INVALID_DATE_TIME_FORMAT } |
Public Member Functions | |
CIMDateTime () | |
Create a new interval type of CIMDateTime set to 0's. | |
~CIMDateTime () | |
CIMDateTime (CIMNULL_t) | |
Create a new interval type of CIMDateTime this object will have a null implementation. | |
CIMDateTime (const CIMDateTime &arg) | |
Create a new CIMDateTime object that is a copy of another. | |
CIMDateTime (const String &arg) | |
Create a new CIMDateTime object from a string representation of a CIM DateTime (See description of this string format in the class documentation of CIMDateTime. | |
CIMDateTime (const DateTime &arg) | |
Create an CIMDateTime object from a regular DateTime object. | |
CIMDateTime (UInt64 microSeconds) | |
Create an CIMDateTime object that represents an interval. | |
CIMDateTime (const detail::CIMDateTimeRepRef &rep) | |
CIMDateTime & | operator= (const CIMDateTime &arg) |
Assignment operation. | |
UInt16 | getYear () const |
UInt8 | getMonth () const |
UInt32 | getDays () const |
UInt32 | getDay () const |
UInt8 | getHours () const |
UInt8 | getMinutes () const |
UInt8 | getSeconds () const |
UInt32 | getMicroSeconds () const |
Int16 | getUtc () const |
bool | equal (const CIMDateTime &arg) const |
Check if another CIMDateTime object is equal to this one. | |
CIMDateTime & | setYear (UInt16 arg) |
Set the year component of the CIMDateTime object. | |
CIMDateTime & | setMonth (UInt8 arg) |
Set the month component of the CIMDateTime object. | |
CIMDateTime & | setDays (UInt32 arg) |
Set the days component of the CIMDateTime object. | |
CIMDateTime & | setDay (UInt32 arg) |
Set the day component of the CIMDateTime object. | |
CIMDateTime & | setHours (UInt8 arg) |
Set the hours component of the CIMDateTime object. | |
CIMDateTime & | setMinutes (UInt8 arg) |
Set the minutes component of the CIMDateTime object. | |
CIMDateTime & | setSeconds (UInt8 arg) |
Set the seconds component of the CIMDateTime object. | |
CIMDateTime & | setMicroSeconds (UInt32 arg) |
Set the microseconds component of the CIMDateTime object. | |
CIMDateTime & | setUtc (Int16 arg) |
Set the utc offset component of the CIMDateTime object. | |
bool | isInterval () const |
void | setInterval (bool val) |
void | readObject (std::istream &istrm) |
Read this object from an input stream. | |
void | writeObject (std::ostream &ostrm) const |
Write this object to an output stream. | |
String | toString () const |
DateTime | toDateTime () const |
operator safe_bool () const | |
bool | operator! () const |
detail::CIMDateTimeRepRef | getRep () const |
Private Attributes | |
detail::CIMDateTimeRepRef | m_rep |
Friends | |
OWBI1_OWBI1PROVIFC_API bool | operator== (const CIMDateTime &x, const CIMDateTime &y) |
OWBI1_OWBI1PROVIFC_API bool | operator< (const CIMDateTime &x, const CIMDateTime &y) |
Compare 2 CIMDateTime instances. |
Recall that a CIM datetime may contain a date or an interval.
A date has the following form:
yyyymmddhhmmss.mmmmmmsutc
Where
yyyy = year (0000-9999) mm = month (01-12) dd = day (01-31) hh = hour (00-23) mm = minute (00-59) ss = second (00-60) normally 59, but a leap second may be present mmmmmm = microseconds (0-999999). s = '+' or '-' to represent the UTC sign. utc = UTC offset (same as GMT offset). utc is the offset from UTC in minutes. It's worth noting that when daylight saving time is in effect, the utc will be different then when it's not.
An interval has the following form:
ddddddddhhmmss.mmmmmm:000
Where
dddddddd = days hh = hours mm = minutes ss = seconds mmmmmm = microseconds
Note that intervals always end in ":000" (this is how they are distinguished from dates).
Intervals are really durations since they do not specify a start and end time (as one expects when speaking about an interval). It is better to think of an interval as specifying time elapsed since some event.
Values must be zero-padded so that the entire string is always the same 25-character length. Fields which are not significant must be replaced with asterisk characters.
CIMDateTime objects are constructed from C character strings or from DateTime objects. These character strings must be exactly twenty-five characters and conform to one of the forms idententified above.
CIMDateTime objects which are not explicitly initialized will be implicitly initialized with the null time interval:
00000000000000.000000:000
Instances can be tested for nullness with the isNull() method.
Definition at line 113 of file OWBI1_CIMDateTime.hpp.
|
Definition at line 310 of file OWBI1_CIMDateTime.hpp. |
|
Definition at line 133 of file OWBI1_CIMDateTime.hpp. |
|
Create a new interval type of CIMDateTime set to 0's.
Definition at line 60 of file OWBI1_CIMDateTime.cpp. |
|
Definition at line 65 of file OWBI1_CIMDateTime.cpp. |
|
Create a new interval type of CIMDateTime this object will have a null implementation.
Definition at line 69 of file OWBI1_CIMDateTime.cpp. |
|
Create a new CIMDateTime object that is a copy of another.
Definition at line 74 of file OWBI1_CIMDateTime.cpp. |
|
Create a new CIMDateTime object from a string representation of a CIM DateTime (See description of this string format in the class documentation of CIMDateTime.
Definition at line 79 of file OWBI1_CIMDateTime.cpp. |
|
Create an CIMDateTime object from a regular DateTime object. This constructor is *not* explicit so that a DateTime can be used where a CIMDateTime may be required.
Definition at line 84 of file OWBI1_CIMDateTime.cpp. |
|
Create an CIMDateTime object that represents an interval.
Definition at line 89 of file OWBI1_CIMDateTime.cpp. |
|
Definition at line 95 of file OWBI1_CIMDateTime.cpp. |
|
Check if another CIMDateTime object is equal to this one.
Definition at line 184 of file OWBI1_CIMDateTime.cpp. References m_rep. Referenced by OWBI1::operator==(). |
|
Definition at line 231 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 228 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 234 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 243 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 237 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 225 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 256 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 240 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 246 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 222 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 249 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 108 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 115 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Assignment operation.
Definition at line 102 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Read this object from an input stream.
|
|
Set the day component of the CIMDateTime object.
Definition at line 142 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the days component of the CIMDateTime object.
Definition at line 135 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the hours component of the CIMDateTime object.
Definition at line 149 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 252 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the microseconds component of the CIMDateTime object.
Definition at line 170 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the minutes component of the CIMDateTime object.
Definition at line 156 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the month component of the CIMDateTime object.
Definition at line 128 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the seconds component of the CIMDateTime object.
Definition at line 163 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the utc offset component of the CIMDateTime object.
Definition at line 177 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Set the year component of the CIMDateTime object.
Definition at line 121 of file OWBI1_CIMDateTime.cpp. References m_rep. |
|
Definition at line 208 of file OWBI1_CIMDateTime.cpp. References toString(). |
|
Definition at line 202 of file OWBI1_CIMDateTime.cpp. References m_rep. Referenced by OWBI1::operator<<(), and toDateTime(). |
|
Write this object to an output stream.
|
|
Compare 2 CIMDateTime instances. An interval is always less than a date/time. Comparing a CIMNULL instance is undefined, and may throw a COWNULLReference exception or dereference a NULL pointer. The result of a comparison with an invalid date/time (any value out of range) is undefined. Definition at line 267 of file OWBI1_CIMDateTime.cpp. |
|
Definition at line 262 of file OWBI1_CIMDateTime.cpp. |
|
Definition at line 325 of file OWBI1_CIMDateTime.hpp. Referenced by equal(), getDay(), getDays(), getHours(), getMicroSeconds(), getMinutes(), getMonth(), getRep(), getSeconds(), getUtc(), getYear(), isInterval(), operator safe_bool(), operator!(), OWBI1::operator<(), operator=(), setDay(), setDays(), setHours(), setInterval(), setMicroSeconds(), setMinutes(), setMonth(), setSeconds(), setUtc(), setYear(), and toString(). |