TimeStamps
Chapter Updated 08/18/25
| Method | Description | Parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| xbTimeStamp() xbTimeStamp( xbInt32 lDate, xbInt32 lTime ) xbTimeStamp( xbInt32 lDate, xbTime tm ) xbTimeStamp( xbDate dt, xbInt32 lTime ) xbTimeStamp( xbDate dt, xbTime tm ) xbTimeStamp( const xbString &sTs ) |
Various constructors. | lDate - long integer date value - the number of days since 01/01/4713 BC. lTime - long integer time value - hours * 3600000L + minutes * 60000L + Seconds * 1000L. dt - xbDate object as input value. tm - xbTime oject as input value. sTs - String in the format of YYYY-MM-DD hh:mm:ss |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ~xbTimeStamp() | Destructor. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbInt16 Add( char cType, xbInt32 lAmt) | Add or subtract date or time amounts from the object. | cType is one of: lAmt is the number of units to add to the date time object. Use negative numbers to subtract. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void Dump() void Dump( xbString & sHeader ) |
Dump class internals to stdout | sHeader - optional header message included with time internals. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbInt32 GetDate() const xbInt32 GetDate( xbDate &dtOut ) const |
Return the date portion of the time stamp. | dtOut - Output xbDate object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void GetFormattedTimeStamp( const xbString &sFormatSpecifiers, xbString &sFormattedOutput ) | Returns a formatted time stamp. This routine calls the standard C strftime function and uses the format specifiers associated with the function to create a formatted timestamp. | sFormattedOutput - Output string value sFormatSpecifiers - C string containing any combination of regular characters and special format specifiers. Format specifiers are replaced by the function to the corresponding values to represent the time stamp. They all begin with a percentage (%) sign.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbInt32 GetTime() const xbInt32 GetTime( xbTime &tmOut ) const |
Return the time portion of the time stamp. | dtOut - Output xbTime object. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void SetTmStruct( struct tm *timePtr ) | Populate a C standard struct tm date and time field from the xbTimeStamp Value. | timePtr - Pointer to allocated time structure. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool IsNull() const | Returns xbTrue if the timestamp is null, else returns xbFalse. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void Now() | Set the time stamp to the current system date and time. Same as method Systime(). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void SetDate( xbInt32 lDate ) | Set the date portion of the time stamp. | lDate - long integer date value. The number of days since 01/01/4713 BC. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void SetDate( xbDate &dt ) | Set the date portion of the time stamp. | dt - xbDate object as input value. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void SetNull() | Initialize the time stamp to null. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void SetTime( xbInt32 lTime ) void SetTime( xbTime &tm ) |
Set the time portion of the time stamp. | tm - xbTime oject as input value. lTime - long integer time value = (hours * 3600000L + minutes * 60000L + Seconds * 1000L). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| void Systime() | Set DateTime to the system date and time. Same as method Now() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbTimeStamp &operator = (const xbTimeStamp &dt) | Set operator, returns xbTimeStamp. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator == (const xbTimeStamp &dt) const | Equality operator. Returns xbTrue if xbTimeStamps match else returns xbFalse. |
dt - DateTime to compare. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator != (const xbTimeStamp &dt) const | Inequality operator. Returns xbTrue if xbTimeStamps don't match else returns xbFalse. |
dt - DateTime to compare. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator < (const xbTimeStamp &dt) const | Less than operator. Returns xbTrue if dt is less than else returns xbFalse. | dt - DateTime to compare. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator <= (const xbTimeStamp &dt) const | Less than or equal operator. Returns xbTrue if dt is less than or equal else returns xbFalse. |
dt - DateTime to compare. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator > (const xbTimeStamp &dt) const | Greater than operator. Returns xbTrue if dt is greater than else returns xbFalse. |
dt - DateTime to compare. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| xbBool operator >= (const xbTimeStamp &dt) const | Greater than or equal operator. Returns xbTrue if dt is greater than or equal else returns xbFalse. |
dt - DateTime to compare. |
