     13.9    TTime    
 - ( 14  17-22).     , 
          
.   DOS,   bcc appoint3 time3,   
       APPOINT3.EXE.   
      APPOINT3.IDE   
<Ctrl+F9>    . 

     13.9.  (   TTime   -) 

    1:    // time3.h --   TTime 
    2  
    3:    #ifndef _I_ 
    4:    #define _TIME3_H 1 //  ((include 
    5:    
    6:    #include <iostream.h>                 
    7:    # include <time.h>                             
    8:    #include <string.h>                      
    9: 
  10:    class TTime { 
  11:     private:                                                            
  12:	  long dt; //    -    1  1970  
  13:      public: 
  14:	 void Display(void) { cout  ctime(&dt); } 
  15:	 void 6etTime(int &m, int &d, int &y, int &hr, int &min); 
  16:	 void SetTime(int m, int d, int y, int hr, int min);                    
  17:	 char *GetSTime(void) 
  18:	{ 
  19:	  char *cp = strdup(ctime(&dt)); 
  20:	  return cp; 
  21:	} 
  22:	void ChangeTime(long nminutes) { dt += (nminutes * 60);  } 
  23:     } ; 
  24: 
  25:   #endif // __IME_ 

          TIME3.H  
   13.10 c . 

     13.10.  TIME3.CPP (    TTime) 

    1:	// timeS.cpp --   TTime 
    2: 
    3:	#include <dos.h>                                                       
    4:	#include "timeS.h" 
    5:	
    6:	//   -                     
    7:	void TTime::GetTime(int &m, int &d, int &y, int &hr, int &min) 
    8:	{                                                : 
    9:	struct date ds;                                
  10:	struct time ts;                                      
  11:
  12:	unixtodos(dt, &ds. &ts);                 
  13:	y.= ds.da_year; 
  14:	m = ds.da_mon; 
  15:	d = ds.da_day; 
  16:	hr = ts.ti_hour;                                                      
  17:          min = ts.ti min;	
  19: 
  20:	//   dt 
  21:	void TTime: :SetTime(int m,  int d,  int y,  int ir, int min)
  22:	{ 
  23:	struct date ds;                                                        
  24:	struct time ts;                                                        
  25: 
  26:	ds.da_year = y; 
  27:	ds.da mon = m; 
  28:	ds.dalday = d; 
  29:	ts.tijiour = hr; 
  30:	ts.tijnin = min;                                                       
  31:	ts.ti_sec = 0; 
  32:	ts,ti_hund = 0; 
  33:	dt = dostounix(&ds, &ts); 
  34:	} 
    
     13.  	317 