The ITimeStamp class defines information functions that you can use to obtain specific information about an ITimeStamp object. For example, you can determine the number of seconds separating the ITimeStamp object from the reference date (01/01/2000 00:00:00). You can also find out what the current timestamp is.
Conversion operators have been provided that allow you to convert an existing ITimeStamp object to an IDate object or an ITime object. Once the object has been converted, the IDate or ITime information functions may be then be used.
The following example shows some of the ITimeStamp information functions:
ITimeStamp RefDate; ITimeStamp TmStamp = ITimeStamp::currentTimeStamp();
IDate ADate = TmStamp; ITime ATime = TmStamp;
cout << TmStamp << " is " << Seconds << " seconds apart from" << endl; cout << RefDate << endl; cout << ATime.hours() << ":" << ATime.minutes() << ":"; cout << ATime.seconds90 << "," << ADate.dayOfYear(); cout << " days in year " << ADate.year() << endl;
This example produces the following output:
05/15/1996 17:50:56 is -1.14502e+08 seconds apart from 01/01/2000 00:00:00 17:50:56, 136 days in year 1996
![]()
Information Functions for
IDate Objects
Information Functions
for ITime Objects