Link to home
Start Free TrialLog in
Avatar of computer_help
computer_help

asked on

Obtaining relative times

I am writting a program(Visual C++ 6.0) to detelete files older than 30 days.  In order to do this I have been using the GetFileTime function.  I then was going to try to add 30 days to this value and use CompareFileTime to determine if the file needs to be deleted.

In order to add 30 days to a FileTime I was under the impression that you had to:
a) Convert your times from SYSTETIME to FILETIME using SystemTimeToFileTime function:
b) Copy the resulting FILETIME structure to a LARGE_INTEGER strucutre.
c) Use normal arithmetics on LARGE_INTEGER value.

However I can not get this to work .  If someone could show me an example of adding 30 days to a file time, or suggest a time library that would take care of all this for me that would be great.
ASKER CERTIFIED SOLUTION
Avatar of corduroy9
corduroy9

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of computer_help
computer_help

ASKER

Thank you very much, that worked fine.