CFileTime Class
This class provides methods for managing the date and time values associated with a file.
class CFileTime :
public FILETIME
Members
Public Constructors
Name |
Description |
---|---|
The constructor. |
Public Methods
Name |
Description |
---|---|
Call this static function to retrieve a CFileTime object that represents the current system date and time. |
|
Call this method to retrieve the time from the CFileTime object. |
|
Call this method to convert a local file time to a file time based on the Coordinated Universal Time (UTC). |
|
Call this method to set the date and time stored by the CFileTime object. |
|
Call this method to convert time based on the Coordinated Universal Time (UTC) to local file time. |
Public Operators
Name |
Description |
---|---|
This operator is used to perform subtraction on a CFileTime or CFileTimeSpan object. |
|
This operator compares two CFileTime objects for inequality. |
|
This operator is used to perform addition on a CFileTimeSpan object. |
|
This operator is used to perform addition on a CFileTimeSpan object and assign the result to the current object. |
|
This operator compares two CFileTime objects to determine the lesser. |
|
This operator compares two CFileTime objects to determine equality or the lesser. |
|
The assignment operator. |
|
This operator is used to perform subtraction on a CFileTimeSpan object and assign the result to the current object. |
|
This operator compares two CFileTime objects for equality. |
|
This operator compares two CFileTime objects to determine the larger. |
|
This operator compares two CFileTime objects to determine equality or the larger. |
Public Constants
Name |
Description |
---|---|
A static data member storing the number of 100-nanosecond intervals that make up one day. |
|
A static data member storing the number of 100-nanosecond intervals that make up one hour. |
|
A static data member storing the number of 100-nanosecond intervals that make up one millisecond. |
|
A static data member storing the number of 100-nanosecond intervals that make up one minute. |
|
A static data member storing the number of 100-nanosecond intervals that make up one second. |
|
A static data member storing the number of 100-nanosecond intervals that make up one week. |
Remarks
This class provides methods for managing the date and time values associated with the creation, access and modification of files. The methods and data of this class are frequently used in conjunction with CFileTimeSpan objects, which deal with relative time values.
The date and time value is stored as a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601. This is the Coordinated Universal Time (UTC) format.
The following static const member variables are provided to simplify calculations:
Member variable |
Number of 100-nanosecond intervals |
---|---|
Millisecond |
10,000 |
Second |
Millisecond * 1,000 |
Minute |
Second * 60 |
Hour |
Minute * 60 |
Day |
Hour * 24 |
Week |
Day * 7 |
Note Not all file systems can record creation and last access time and not all file systems record them in the same manner. For example, on the Windows NT FAT file system, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (the access date). On NTFS, access time has a resolution of 1 hour. Furthermore, FAT records times on disk in local time, but NTFS records times on disk in UTC. For more information, see File Times.
Inheritance Hierarchy
FILETIME
CFileTime
Requirements
Header: atltime.h