Solved

Change Date

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now