Solved

Change Date

Posted on 1998-11-28
5
180 Views
Last Modified: 2013-11-20
How do I change the dates of a file I opened? I used to be able to do it in DOS environment using Turbo C. But Windows/MFC doesn't seem to offer this feature anymore. What it offers is to use CFileStatus class, which uses 64-bits clock ticks from 1601 March 1. I don't want to do the conversion myself because it is a lot of hassle. Any suggestion?
0
Comment
Question by:tangkh
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1325430
Simply use the 'SetFileTime()' Win32 API, it is designed for this task ;-)
0
 

Author Comment

by:tangkh
ID: 1325431
this is my point, i dont want to use the tick count (interval of 100 ns). i want to, says, change the file's date by simply typing only 1998:11:23 to change it. I am not going to do the conversion from the tick count to the date... :(
0
 
LVL 86

Expert Comment

by:jkr
ID: 1325432
You're right - it IS a hassle ;-)

But there are several convenience functions that allow the conversion of common time formats into FILETIME structures, e.g. 'DosDateTimeToFileTime()' which can be used to create FILETIME. So you could e.g. still use the 'strftime()', 'asctime()' etc.

0
 

Author Comment

by:tangkh
ID: 1325433
Hohohoho ^o^ you deserved the points. I have been struggling to get this type of function. Thanks :)
0
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 1325434
Thanks ;-)
Glad i could help you!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question