Manipulating File Times

Windows CE provides the GetFileTime function, which returns the file creation time, the last time that the file was accessed, and the last time that the file was written to. Windows CE creates file times in coordinated universal time (UTC) format, also known as Greenwich mean time. Use the FileTimeToLocalFileTime and FileTimeToSystemTime functions to translate the UTC time into the proper time zone format.

You can also set file times with the SetFileTime function. Depending on the file system, before using SetFileTime, you might need to gain access to the file by using CreateFile to open the file. If you change one of the dates on a file in the Windows CE store—for example, the file creation time—by default the other two dates—for example, the last time that the file was accessed and the last time that the file was written to—are updated to the new time as well. This technique works on the current object store, but does not work on a FAT file system.