Times
Chapter Updated 06/19/25
| Method | Description | |
|---|---|---|
| xbTime() xbTime( xbString & sTime ) xbTime( char * sTime ) xbTime( xbInt32 lTime ) xbTime( xbInt16 iHH, xbInt16 iMM, xbInt16 iSS = 0 ) |
xbTime constructor. | |
| void operator=( xbInt32 t ) void operator=( const xbTime &t ) | Set a time equal to another time. | |
| xbBool operator==( const xbTime & ) const | Comapare two times for equality. | |
| xbBool operator!=( const xbTime & ) const | Compare two times for inequality. | |
| xbTime &operator+=( xbInt32 l ) | Increment a time by specified numbed of seconds. | |
| xbTime &operator-=( xbInt32 l ) | Decrement a time by specified number of seconds. | |
| xbTime &operator++( xbInt32 l ) | Increment a time by one second. | |
| xbTime &operator--( xbInt32 l ) | Decrement a time by one second. | |
| xbInt32 operator-( xbInt32 l ) const | Subtract seconds from a time. | |
| xbInt32 operator+( xbInt32 l ) const | Add seconds to a time. | |
| xbBool operator< ( const xbTime & ) const | Less than compare. | |
| xbBool operator> ( const xbTime & ) const | Greater than compare. | |
| xbBool operator<=( const xbTime & ) const | Less than or equal compare. | |
| xbBool operator>=( const xbTime & ) const | Greater than or equal compare. | |
| xbInt32 Add( char cType, xbInt32 lCnt ) | Add or subtract from the time value. cType - one of H,h,M,m,S,s for Hour minute or second for operation. lCnt - Number to add or subtrat from the time. Use a negative number to subtract. Returns the number of days the time would have rolled. For example, adding 50 hours would return +2 days, as the time would have rolled forward two days. Conversely, subtracting 50 hours would return -2. | |
| void Dump() void Dump( xbString & sHeader ) void Dump( const char *sHeader ) | Dump the internal contents of the screen to stdout. Available if XB_DEBUG_SUPPORT compiled into the library. sHeader is an optional header line to display. |
|
| xbInt16 GetHour () const | Return the Hour for the time. | |
| xbInt16 GetMinute() const | Return the Minute for the time. | |
| xbInt16 GetSecond() const | Return the Second for the time. | |
| xbInt32 GetTime () const | Return the time value as a long int. See description for how the value is calculated. | |
| xbInt16 GetTime ( xbString &sTimeOut, xbString &sFmtIn ) | Return the formatted string in sTimeOut
using format specified in sFmtIn. See the beginning of this chapter for list of valid format specifiers. | |
| xbInt16 GetTime ( xbString &sTimeOut ) | Return formatted string in sTimeOut. The format is determinied by searching in the following order for a time format: Object level format System default time format HH:MM:SS | |
| const xbString &GetTimeFormat() const | Return the time format for the given instance. | |
| xbInt16 Set( xbInt32 lTime ) | Set the time to value defined in lTime. | |
| xbInt16 Set( xbTime &tm ) | Set the time to the value defined in tm. | |
| xbInt16 Set( xbInt16 iHH = 0, xbInt16 iMM = 0, xbInt16 iSS = 0 ) | Set the time to the values as defined in iHH, iMM, iSS for hours, minutes and seconds. | |
| void SetTimeFormat( xbString &sFmtIn ) | Set the time format for the given instance to sFmtIn. See valid format specifiers in beginning of chapter. | |
| xbInt16 SetToNow () | Set the time to the system time. |
