Public Member Functions | |
OFTime () | |
default constructor. | |
OFTime (const OFTime &timeVal) | |
copy constructor | |
OFTime (const unsigned int hour, const unsigned int minute, const double second, const double timeZone=0) | |
constructor with init values | |
virtual | ~OFTime () |
destructor | |
virtual OFTime & | operator= (const OFTime &timeVal) |
assignment operator | |
virtual OFBool | operator== (const OFTime &timeVal) const |
comparison operator (equal). | |
virtual OFBool | operator!= (const OFTime &timeVal) const |
comparison operator (unequal) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. | |
virtual OFBool | operator< (const OFTime &timeVal) const |
comparison operator (less than) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. | |
virtual OFBool | operator<= (const OFTime &timeVal) const |
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. | |
virtual OFBool | operator>= (const OFTime &timeVal) const |
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. | |
virtual OFBool | operator> (const OFTime &timeVal) const |
comparison operator (greater than) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared. | |
virtual void | clear () |
reset the time value. | |
virtual OFBool | isValid () const |
check whether the currently stored time value is valid. | |
OFBool | setTime (const unsigned int hour, const unsigned int minute, const double second, const double timeZone=0) |
set the time value to the specified time. | |
OFBool | setHour (const unsigned int hour) |
set the time value to the specified hour. | |
OFBool | setMinute (const unsigned int minute) |
set the time value to the specified minute. | |
OFBool | setSecond (const double second) |
set the time value to the specified second. | |
OFBool | setTimeZone (const double timeZone) |
set the time zone to the specified value. | |
OFBool | setTimeZone (const signed int hour, const unsigned int minute) |
set the time zone to the specified value. | |
OFBool | setTimeInSeconds (const double seconds, const double timeZone=0, const OFBool normalize=OFTrue) |
set the time to the specified number of seconds | |
OFBool | setTimeInHours (const double hours, const double timeZone=0, const OFBool normalize=OFTrue) |
set the time to the specified number of hours | |
OFBool | setCurrentTime () |
set the time value to the current system time. | |
OFBool | setISOFormattedTime (const OFString &formattedTime) |
set the time value to the given ISO formatted time string. | |
unsigned int | getHour () const |
get the currently stored hour value | |
unsigned int | getMinute () const |
get the currently stored minute value | |
double | getSecond () const |
get the currently stored second value | |
unsigned int | getIntSecond () const |
get the integral part of the currently stored second value | |
unsigned int | getMilliSecond () const |
get the milli second part of the currently stored second value | |
unsigned int | getMicroSecond () const |
get the micro second part of the currently stored second value | |
double | getTimeZone () const |
get the currently stored time zone value. | |
double | getTimeInSeconds (const OFBool useTimeZone=OFFalse, const OFBool normalize=OFTrue) const |
get the currently stored time in seconds | |
double | getTimeInHours (const OFBool useTimeZone=OFFalse, const OFBool normalize=OFTrue) const |
get the currently stored time in hours. | |
OFTime | getCoordinatedUniversalTime () const |
get the currently stored time as Coordinated Universal Time. | |
OFTime | getLocalTime () const |
get the currently stored time in local time. | |
OFBool | getISOFormattedTime (OFString &formattedTime, const OFBool showSeconds=OFTrue, const OFBool showFraction=OFFalse, const OFBool showTimeZone=OFFalse, const OFBool showDelimiter=OFTrue) const |
get the current time value in ISO format. | |
Static Public Member Functions | |
static OFTime | getCurrentTime () |
get the current system time | |
static double | getLocalTimeZone () |
get the local time zone. | |
Protected Member Functions | |
OFBool | setCurrentTime (const time_t &tt) |
set the time value to the current system time. | |
Static Protected Member Functions | |
static OFBool | isTimeValid (const unsigned int hour, const unsigned int minute, const double second, const double timeZone) |
check whether the given time is valid. | |
static double | getTimeInSeconds (const unsigned int hour, const unsigned int minute, const double second, const double timeZone=0, const OFBool normalize=OFTrue) |
get the given time in seconds. | |
static double | getTimeInHours (const unsigned int hour, const unsigned int minute, const double second, const double timeZone=0, const OFBool normalize=OFTrue) |
get the given time in hours. | |
Private Attributes | |
unsigned int | Hour |
currently stored hour value | |
unsigned int | Minute |
currently stored minute value | |
double | Second |
currently stored second value (incl. fraction of seconds) | |
double | TimeZone |
currently stored time zone value | |
Friends | |
class | OFDateTime |
Definition at line 54 of file oftime.h.
|
default constructor. Initializes Hour, Minute, Second and TimeZone to 0. |
|
copy constructor
|
|
constructor with init values
|
|
reset the time value. Sets the hour, minute, second and time zone to "0". |
|
get the currently stored time as Coordinated Universal Time. The resulting time object always has a time zone of "+00:00" since the time is corrected regarding the Coordinated Universal Time (UTC).
|
|
get the current system time
|
|
get the currently stored hour value
|
|
get the integral part of the currently stored second value
|
|
get the current time value in ISO format. The two ISO time formats supported by this function are "HH:MM[:SS[.FFFFFF]][&ZZ:ZZ]" (with delimiters) and "HHMM[SS[.FFFFFF]][&ZZZZ]" (without delimiters, useful for DICOM time type) where the brackets enclose optional parts.
|
|
get the currently stored time in local time. The resulting time object always has the local time zone.
|
|
get the local time zone. This function uses operating system dependent routines. If they are unavailable for some reason the Coordinated Universal Time is assumed (time zone offset = 0).
|
|
get the micro second part of the currently stored second value
|
|
get the milli second part of the currently stored second value
|
|
get the currently stored minute value
|
|
get the currently stored second value
|
|
get the given time in hours.
|
|
get the currently stored time in hours.
|
|
get the given time in seconds.
|
|
get the currently stored time in seconds
|
|
get the currently stored time zone value. The time zone is given as the offset (in hours) to the Coordinated Universal Time (UTC). Valid values are for instance "+1.0" (plus one hour) and "-2.5" (minus two and a half hour, i.e. 2 hours and 30 minutes).
|
|
check whether the given time is valid. Valid ranges: [0,24[ for 'hour', [0,60[ for 'minute', [0.0,60.0[ for 'second' and [-12.0,+12.0] for 'timeZone'
|
|
check whether the currently stored time value is valid. Valid ranges: [0,24[ for 'hour', [0,60[ for 'minute', [0.0,60.0[ for 'second' and [-12.0,+12.0] for 'timeZone'
|
|
comparison operator (unequal) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared.
|
|
comparison operator (less than) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared.
|
|
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.
|
|
assignment operator
|
|
comparison operator (equal). Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared.
|
|
comparison operator (greater than) Please note that the time values are first transformed to the Coordinated Universal Time (UTC) before they are compared.
|
|
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.
|
|
set the time value to the current system time. This function uses operating system dependent routines. If they are unavailable for some reason the current value is not modified.
|
|
set the time value to the current system time. This function uses operating system dependent routines. If they are unavailable for some reason the current value is not modified.
|
|
set the time value to the specified hour. Before the new value is set it is checked using the "isValid()" routine.
|
|
set the time value to the given ISO formatted time string. The two ISO time formats supported by this function are "HH:MM[:SS]" (with arbitrary delimiters) and "HHMM[SS]" (without delimiters) where the brackets enclose optional parts. The optional fractional part of a second and the time zone (see getISO...) are not yet supported.
|
|
set the time value to the specified minute. Before the new value is set it is checked using the "isValid()" routine.
|
|
set the time value to the specified second. Before the new value is set it is checked using the "isValid()" routine.
|
|
set the time value to the specified time. Before the new value is set it is checked using the "isValid()" routine.
|
|
set the time to the specified number of hours
|
|
set the time to the specified number of seconds
|
|
set the time zone to the specified value. The time zone is given as the offset (in hours and minutes) to the Coordinated Universal Time (UTC). Before the new value is set it is checked using the "isValid()" routine.
|
|
set the time zone to the specified value. The time zone is given as the offset (in hours) to the Coordinated Universal Time (UTC). Valid values are for instance "+1.0" (plus one hour) and "-2.5" (minus two and a half hour, i.e. 2 hours and 30 minutes). Before the new value is set it is checked using the "isValid()" routine.
|