This documentation is archived and is not being maintained.

CTime Class

class CTime

Remarks

CTime does not have a base class.

A CTime object represents an absolute time and date.

CTime values are based on coordinated universal time (UTC), which is equivalent to Greenwich mean time (GMT). The local time zone is controlled by the TZ environment variable.

When creating a CTime object, set the nDST parameter to 0 to indicate that standard time is in effect, or to a value greater than 0 to indicate that daylight savings time is in effect, or to a value less than zero to have the C run-time library code compute whether standard time or daylight savings time is in effect. tm_isdst is a required field. If not set, its value is undefined and the return value from mktime is unpredictable. If timeptr points to a tm structure returned by a previous call to asctime, gmtime, or localtime, the tm_isdst field contains the correct value.

A companion class, CTimeSpan, represents a time interval.

The CTime and CTimeSpan classes are not designed for derivation. Because there are no virtual functions, the size of CTime and CTimeSpan objects is exactly 8 bytes. Most member functions are inline.

Note   The upper date limit is January 18, 2038. For a wider range of dates, see COleDateTime.

For more information on using CTime, see the articles Date and Time, and Time Management in the Run-Time Library Reference.

Requirements

Header: atltime.h

See Also

Class Members | asctime | _ftime | gmtime | localtime | strftime | time | Hierarchy Chart | Shared Classes

Show: