Solved

Change Date

Posted on 1998-11-28
5
183 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 99
Expand macro to include alternate header placement and naming 5 75
Perl Awk Need Help 3 128
Line meaning 9 87
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

840 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