DCMTK Version 3.6.7
OFFIS DICOM Toolkit
|
This class is a combination of OFDate and OFTime. More...
Public Member Functions | |
OFDateTime () | |
default constructor. More... | |
OFDateTime (const OFDateTime &dateTime) | |
copy constructor More... | |
OFDateTime (const OFDate &dateVal, const OFTime &timeVal) | |
copy constructor More... | |
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=0) | |
constructor More... | |
virtual | ~OFDateTime () |
destructor | |
virtual OFDateTime & | operator= (const OFDateTime &dateTime) |
assignment operator More... | |
virtual OFBool | operator== (const OFDateTime &dateTime) const |
comparison operator (equal). More... | |
virtual OFBool | operator!= (const OFDateTime &dateTime) const |
comparison operator (unequal). More... | |
virtual OFBool | operator< (const OFDateTime &dateTime) const |
comparison operator (less than). More... | |
virtual OFBool | operator<= (const OFDateTime &dateTime) const |
comparison operator (less than or equal). More... | |
virtual OFBool | operator>= (const OFDateTime &dateTime) const |
comparison operator (greater than or equal). More... | |
virtual OFBool | operator> (const OFDateTime &dateTime) const |
comparison operator (greater than). More... | |
virtual void | clear () |
reset the date/time value. More... | |
virtual OFBool | isValid () const |
check whether the currently stored date and time value is valid. More... | |
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=0) |
set the date/time value. More... | |
OFBool | setDate (const OFDate &dateVal) |
set the date component to the specified date. More... | |
OFBool | setTime (const OFTime &timeVal) |
set the time component to the specified time. More... | |
OFBool | setDateTime (const OFDate &dateVal, const OFTime &timeVal) |
set the date and time component to the specified date/time. More... | |
OFBool | setCurrentDateTime () |
set the date and time value to the current system date and time. More... | |
OFBool | setISOFormattedDateTime (const OFString &formattedDateTime) |
set the date/time value to the given ISO formatted date/time string. More... | |
const OFDate & | getDate () const |
get the current date component More... | |
const OFTime & | getTime () const |
get the current time component More... | |
OFBool | getISOFormattedDateTime (OFString &formattedDateTime, const OFBool showSeconds=OFTrue, const OFBool showFraction=OFFalse, const OFBool showTimeZone=OFFalse, const OFBool showDelimiter=OFTrue, const OFString &dateTimeSeparator=" ", const OFString &timeZoneSeparator=" ") const |
get the current date/time value in ISO format. More... | |
Static Public Member Functions | |
static OFDateTime | getCurrentDateTime () |
get the current system date and time More... | |
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.
OFDateTime::OFDateTime | ( | const OFDateTime & | dateTime | ) |
copy constructor
dateTime | date/time object to be copied |
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 = 0 |
||
) |
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 |
|
virtual |
reset the date/time value.
Sets all date and all time components to '0'. NB: Date becomes invalid.
|
static |
get the current system date and time
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 OFString & | dateTimeSeparator = " " , |
||
const OFString & | timeZoneSeparator = " " |
||
) | const |
get the current date/time value in ISO format.
The two ISO time formats supported by this function are
formattedDateTime | reference to string variable where the result is stored |
showSeconds | add optional seconds (":SS" or "SS") to the resulting string if OFTrue |
showFraction | add optional fractional part of a second (".FFFFFF") if OFTrue. Requires parameter 'seconds' to be also OFTrue. |
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 "&" is a placeholder for the sign symbol ("+" or "-"). |
showDelimiter | flag, indicating whether to use delimiters ("-", ":" and " ") or not |
dateTimeSeparator | separator between ISO date and time value. Only used if 'showDelimiter' is true. |
timeZoneSeparator | separator between ISO time value and time zone. 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 |
|
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 |
|
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 |
|
virtual |
assignment operator
dateTime | date/time value to be set |
|
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 |
|
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 |
|
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 |
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()" routine.
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()" routine.
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 = 0 |
||
) |
set the date/time value.
Before the new value is set it is checked using the "isValid()" routine.
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 |
OFBool OFDateTime::setISOFormattedDateTime | ( | const OFString & | formattedDateTime | ) |
set the date/time value to the given ISO formatted date/time string.
The two ISO date/time formats supported by this function are
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()" routine.
timeVal | new time value to be set |