home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
PJ65.ARC
/
DT.CXX
< prev
next >
Wrap
Text File
|
1988-08-18
|
1KB
|
43 lines
(C) Copyright Aspen Scientific. All rights reserved.
// test program for the OS/2 date and time classes
//
// compile/link with OASYS: ccxx dt.cxx datetime.cxx
#define INCL_DOSPROCESS // directs os2 header definitions
#include <os2.h>
#include <stream.hxx>
#include "datetime.hxx"
// program start-up
int main()
{
DateAndTime Then;
cout << "Then: " << Then.Show();
// go inactive for 1000 milliseconds, or one second
DosSleep( 1000L );
DateAndTimePlus Now(1, 1);
cout << "Now : " << Now.Show();
// show the date and time separately
cout << "Date: " << Now.ShowDate() << "Time: " << Now.ShowTime();
// now use the newly available routines from the
// derived class DateAndTimePlus
cout << "Hour: " << Now.GetHours() << "\n";
cout << "Min : " << Now.GetMinutes() << "\n";
cout << "Sec : " << Now.GetSeconds() << "\n";
cout << "Hund: " << Now.GetHundredths() << "\n";
cout << "Day : " << Now.GetDay() << "\n";
cout << "Mon : " << Now.GetMonth() << "\n";
cout << "Year: " << Now.GetYear() << "\n";
cout << "Zone: " << Now.GetTimeZone() << "\n";
cout << "WDay: " << Now.GetWeekDay() << "\n";
exit( 0 );
}