QUESTION: How to set the time and date for a file's creation or modification 
Author Message
 QUESTION: How to set the time and date for a file's creation or modification

I'm sure this question has been asked and answered hundreds of times,
but after some research I've come up dry...

How can the time and date information that is displayed in the
"Modified" column of the Windows explorer for each file be set to a
desired value? For example, I want my .exe to have a time and date
stamp of 8/12/1999, 12:00 AM rather than 4:43 PM which is when the
file was _really_ created/modified.

e-mail responses would be appreciated.

Thanks,
Jim Moore



Sat, 09 Feb 2002 03:00:00 GMT  
 QUESTION: How to set the time and date for a file's creation or modification

Quote:
> How can the time and date information that is displayed in the
> "Modified" column of the Windows explorer for each file be set to a
> desired value? For example, I want my .exe to have a time and date
> stamp of 8/12/1999, 12:00 AM rather than 4:43 PM which is when the
> file was _really_ created/modified.

BOOL SetFileTime(
  HANDLE hFile,                      // handle to the file
  CONST FILETIME *lpCreationTime,    // time the file was created
  CONST FILETIME *lpLastAccessTime,  // time the file was last accessed
  CONST FILETIME *lpLastWriteTime    // time the file was last written
);

typedef struct _FILETIME { // ft
  DWORD dwLowDateTime;
  DWORD dwHighDateTime;

Quote:
} FILETIME;

BOOL SystemTimeToFileTime(
  CONST SYSTEMTIME *lpSystemTime, // address of system time to convert
  LPFILETIME lpFileTime  // address of buffer for converted file time
);

typedef struct _SYSTEMTIME {  // st
  WORD wYear;    
  WORD wMonth;
  WORD wDayOfWeek;    
  WORD wDay;    
  WORD wHour;    
  WORD wMinute;
  WORD wSecond;    
  WORD wMilliseconds;

Quote:
} SYSTEMTIME;
> e-mail responses would be appreciated.

You post it here, you read it here.


Sat, 09 Feb 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Checking file creation/modification dates

2. Date of a file's last modification

3. Compiler-specific Question - Change File's Date/Time

4. File Creation Date/Time Stamp

5. File Creation Date/Time

6. Getting a file list based on creation date/time

7. Touching a file (set to current time and date)

8. How to set file date/time?

9. Set Date in Date Time Picker

10. set file time & date

11. set date/time/time zone dialog

12. Retrieving File's Date and time

 

 
Powered by phpBB® Forum Software