     13.15. TIME5.H (   TTime   
 -  ) 

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

  15  1998     SetTimeO.  
     ,    
    -1,     
,                                                   

    today. SetTimed,   15,   1998,   -1,   -1); 

       TTime       
- SetTime().   13.16  .  TIME5.CPP 
  ,    ,      
 . 
     -         
 21.         -. 
      13.17    TTime. ,   
   -     
      SetTime().   
 ,      . ,    
  .        
 TIME5,   DOS bcc default time5.     
   Easy Win-,     Project 
  DEFAULT. IDE   <Ctrl+F9>. 

     13.16.  TIME5.CPP (   TTime) 

    1:   // time5.cpp    TTime 
    2: 
    3:      #include <dos.h> 
    4:      #include "time5.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:	   = ds.da_year; 
    14:	  m = ds.da_mon;                                 
    15:	  d = ds.da_day; 


    322       III.   ANSI C++ 
