|
DCMTK Version 3.7.1
OFFIS DICOM Toolkit
|
This class is a combination of OFDate and OFTime. More...
Public Member Functions | |
| OFDateTime () | |
| default constructor. | |
| OFDateTime (const OFDateTime &dateTime) | |
| copy constructor | |
| OFDateTime (const OFDate &dateVal, const OFTime &timeVal) | |
| copy constructor | |
| OFDateTime (const unsigned int year, const unsigned int month, const unsigned int day, const unsigned int hour, const unsigned int minute, const double second, const double timeZone=OFTime::unspecifiedTimeZone) | |
| constructor | |
| virtual | ~OFDateTime () |
| destructor | |
| virtual OFDateTime & | operator= (const OFDateTime &dateTime) |
| assignment operator | |
| virtual OFBool | operator== (const OFDateTime &dateTime) const |
| comparison operator (equal). | |
| virtual OFBool | operator!= (const OFDateTime &dateTime) const |
| comparison operator (unequal). | |
| virtual OFBool | operator< (const OFDateTime &dateTime) const |
| comparison operator (less than). | |
| virtual OFBool | operator<= (const OFDateTime &dateTime) const |
| comparison operator (less than or equal). | |
| virtual OFBool | operator>= (const OFDateTime &dateTime) const |
| comparison operator (greater than or equal). | |
| virtual OFBool | operator> (const OFDateTime &dateTime) const |
| comparison operator (greater than). | |
| virtual void | clear () |
| reset the date/time value. | |
| virtual OFBool | isValid () const |
| check whether the currently stored date and time value is valid. | |
| OFBool | setDateTime (const unsigned int year, const unsigned int month, const unsigned int day, const unsigned int hour, const unsigned int minute, const double second, const double timeZone=OFTime::unspecifiedTimeZone) |
| set the date/time value. | |
| OFBool | setDate (const OFDate &dateVal) |
| set the date component to the specified date. | |
| OFBool | setTime (const OFTime &timeVal) |
| set the time component to the specified time. | |
| OFBool | setDateTime (const OFDate &dateVal, const OFTime &timeVal) |
| set the date and time component to the specified date/time. | |
| OFBool | setCurrentDateTime () |
| set the date and time value to the current system date and time. | |
| OFBool | setISOFormattedDateTime (const OFString &formattedDateTime) |
| set the date/time value to the given ISO formatted date/time string. | |
| const OFDate & | getDate () const |
| get the current date component | |
| const OFTime & | getTime () const |
| get the current time component | |
| OFBool | getISOFormattedDateTime (OFString &formattedDateTime, const OFBool showSeconds=OFTrue, const OFBool showFraction=OFFalse, const OFBool showTimeZone=OFFalse, const OFBool showDelimiter=OFTrue, const OFBool createMissingPart=OFFalse, const OFString &dateTimeSeparator=" ", const OFString &timeZoneSeparator=" ") const |
| get the current date/time value in ISO format. | |
Static Public Member Functions | |
| static OFDateTime | getCurrentDateTime () |
| get the current system date and time | |
Private Attributes | |
| OFDate | Date |
| currently stored date value | |
| OFTime | Time |
| currently stored time value | |
Friends | |
| class | DcmDateTime |
| let DcmDateTime access the members directly | |
| class | DcmAttributeMatching |
| let DcmAttributeMatching access the members directly | |
This class is a combination of OFDate and OFTime.
| OFDateTime::OFDateTime | ( | ) |
default constructor.
Initializes Date and Time to 0.
Referenced by OFDateTime(), getCurrentDateTime(), operator!=(), operator<(), operator<=(), operator=(), operator==(), operator>(), and operator>=().
| OFDateTime::OFDateTime | ( | const OFDateTime & | dateTime | ) |
copy constructor
| dateVal | date object to be copied |
| timeVal | time object to be copied |
| OFDateTime::OFDateTime | ( | const unsigned int | year, |
| const unsigned int | month, | ||
| const unsigned int | day, | ||
| const unsigned int | hour, | ||
| const unsigned int | minute, | ||
| const double | second, | ||
| const double | timeZone = OFTime::unspecifiedTimeZone ) |
constructor
| year | year value to be set |
| month | month value to be set |
| day | new value to be set |
| hour | hour value to be set |
| minute | minute value to be set |
| second | second value to be set (incl. fraction of seconds) |
| timeZone | optional offset to Coordinated Universal Time (UTC) in hours |
References OFTime::unspecifiedTimeZone.
|
virtual |
reset the date/time value.
Sets all date and all time components to "0" (or "unspecified" in case of the time zone). Please note that the date becomes invalid.
|
static |
get the current system date and time
References OFDateTime().
| const OFDate & OFDateTime::getDate | ( | ) | const |
get the current date component
| OFBool OFDateTime::getISOFormattedDateTime | ( | OFString & | formattedDateTime, |
| const OFBool | showSeconds = OFTrue, | ||
| const OFBool | showFraction = OFFalse, | ||
| const OFBool | showTimeZone = OFFalse, | ||
| const OFBool | showDelimiter = OFTrue, | ||
| const OFBool | createMissingPart = OFFalse, | ||
| const OFString & | dateTimeSeparator = " ", | ||
| const OFString & | timeZoneSeparator = " " ) const |
get the current date/time value in ISO format.
The ISO time formats supported by this function are
where the brackets enclose optional parts, the 'T' stands for the literal symbol "T", and the "&" is a placeholder for the sign symbol ("+" or "-").
| formattedDateTime | reference to string variable where the result is stored |
| showSeconds | add optional seconds (":SS" or "SS") to the resulting string if OFTrue. By default, the seconds are only added if a value is specified. |
| showFraction | add optional fractional part of a second (".FFFFFF") if OFTrue. Requires parameter 'seconds' to be also OFTrue. By default, the fractional part is only added if the second value is not an integer (see OFTime::hasFractionOfSecond()). |
| showTimeZone | add optional time zone ("&ZZ:ZZ" or "&ZZZZ") to the resulting string if OFTrue. The time zone indicates the offset from the Coordinated Universal Time (UTC) in hours and minutes. The time zone is only added if a value is specified. |
| showDelimiter | flag, indicating whether to use delimiters ("-", ":" and " ") or not |
| createMissingPart | if OFTrue, create optional parts (seconds and fractional part of a second) even if not specified (see OFTime::hasSecond() and OFTime::hasFractionOfSecond()) |
| dateTimeSeparator | separator between ISO date and time value, e.g. " " (default) or "T" (for ISO 8601 format). Only used if 'showDelimiter' is true. |
| timeZoneSeparator | separator between ISO time value and time zone, e.g. " " (default) or "" (for ISO 8601 format). Only used if 'showDelimiter' is true. |
| const OFTime & OFDateTime::getTime | ( | ) | const |
get the current time component
|
virtual |
|
virtual |
comparison operator (unequal).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
|
virtual |
comparison operator (less than).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
|
virtual |
comparison operator (less than or equal).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
|
virtual |
assignment operator
| dateTime | date/time value to be set |
References OFDateTime().
|
virtual |
comparison operator (equal).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
|
virtual |
comparison operator (greater than).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
|
virtual |
comparison operator (greater than or equal).
Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. However, the special case that there is an "overflow" from one day to another is currently not handled.
| dateTime | date and time value compared with the current value |
References OFDateTime().
| OFBool OFDateTime::setCurrentDateTime | ( | ) |
set the date and time value to the current system date and time.
This function uses operating system dependent routines. If the date or time function (or both) are unavailable for some reason, the corresponding value is not modified.
| OFBool OFDateTime::setDate | ( | const OFDate & | dateVal | ) |
set the date component to the specified date.
Before the new value is set, it is checked using the isValid() method.
| dateVal | new date value to be set |
set the date and time component to the specified date/time.
Before the new value is set, it is checked using the isValid() method.
| dateVal | new date value to be set |
| timeVal | new time value to be set |
| OFBool OFDateTime::setDateTime | ( | const unsigned int | year, |
| const unsigned int | month, | ||
| const unsigned int | day, | ||
| const unsigned int | hour, | ||
| const unsigned int | minute, | ||
| const double | second, | ||
| const double | timeZone = OFTime::unspecifiedTimeZone ) |
set the date/time value.
Before the new value is set, it is checked using the isValid() method.
| year | new year value to be set |
| month | new month value to be set |
| day | new day value to be set |
| hour | new hour value to be set |
| minute | new minute value to be set |
| second | new second value to be set (incl. fraction of seconds) |
| timeZone | optional offset to Coordinated Universal Time (UTC) in hours |
References OFTime::unspecifiedTimeZone.
| OFBool OFDateTime::setISOFormattedDateTime | ( | const OFString & | formattedDateTime | ) |
set the date/time value to the given ISO formatted date/time string.
The most common ISO date/time formats supported by this function are
where the brackets enclose optional parts, the 'T' stands for the literal symbol "T", and the "&" is a placeholder for the sign symbol ("+" or "-"). The pattern "FFFFFF" contains a fractional part of a second. If specified, it shall contain one to six digits representing a range from 0 to 999999. In the first two formats listed, spaces between date, time and time zone components are accepted. Leading or trailing spaces are never accepted.
| formattedDateTime | ISO formatted date/time value to be set |
| OFBool OFDateTime::setTime | ( | const OFTime & | timeVal | ) |
set the time component to the specified time.
Before the new value is set, it is checked using the isValid() method.
| timeVal | new time value to be set |