Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
CTime::CTime
CTime                                       Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  CTime();
  CTime( const CTime& timeSrc );
  CTime( time_t time );
  CTime( int nYear, int nMonth, int nDay, int nHour, int nMin,
         int nSec );
 
  Parameter                                Description
 
  <timeSrc>                                Indicates a CTime object that
                                           already exists.
 
  <time>                                   Indicates a time value.
 
  <nYear>, <nMonth>, <nDay>, <nHour>, <nMin>, <nSec>
                                           Indicate year, month, day,
                                           hour, minute, and second.
 
  Remarks
 
  All these constructors create a new CTime object initialized with the
  specified absolute time, based on the current time zone.
 
  Each constructor is described below:
 
  CTime();                  Constructs a CTime object with a zero
                            (illegal) value.
 
                            NOTE: Zero is an invalid time. This
                                  constructor is provided to allow the
                                  definition of CTime object arrays. You
                                  should initialize such arrays with valid
                                  times prior to use.
 
  CTime( const CTime& );    Constructs a CTime object from another CTime
                            value.
 
  CTime( time_t );          Constructs a CTime object from a time_t type.
 
  CTime( int, int, etc.);   Constructs a CTime object from local time
                            components with each component constrained to
                            the following ranges:
 
                            Component   Range
 
                            <nYear>     1900-2036
 
                            <nMonth>    1-12
 
                            <nDay>      1-31
 
                            <nHour>     0-23
 
                            <nMin>      0-59
 
                            <nSec>      0-59
 
                            This constructor makes the appropriate
                            conversion to UCT.
 
                            The Debug version of the Microsoft Foundation
                            Class Library asserts if one or more of the
                            time-day components is out of range. It is
                            your responsibility to validate the arguments
                            prior to calling.
 
  Example
 
  time_t osBinaryTime;  // C run-time time (defined in <time.h>)
  time( &osBinaryTime ) ;  // get the current time from the operating system
  CTime time1; // empty CTime (0 is illegal time value)
  CTime time2 = time1; // copy constructor
  CTime time3( osBinaryTime ) ;  // CTime from C run-time time
  CTime time4( 1999, 3, 19, 22, 15, 0 ) ; // 10:15PM March 19, 1999
 
 
 
                                     -♦-