Click here to Skip to main content
15,868,016 members
Articles / Desktop Programming / MFC

Timestamp - A utility to change a files "Modified" time.

Rate me:
Please Sign up or sign in to vote.
4.95/5 (32 votes)
15 Jul 2009CPOL1 min read 476K   8K   78   49
A simple utility to change a file - or multiple files - "Modified" time.

timestamp.png

Introduction

Working with a team of programmers in different time zones can be fun, but it can also cause major problems when files from different time zones get mixed and matched. The latest update to a new version of a file may have a date earlier than someone elses old version, meaning it won't be recompiled, or, a new file may have a date later than others meaning DevStudio repeatedly wants to recompile everything.

The solution to this is:

  1. Get everyone to set their computer to the same time. This may work for some, but can be extremely inconvenient to others, or
  2. Re-stamp the time on your files before sending them off to your colleagues.

I chose the latter, which meant I had to come up with a way to restamp file times. Enter TimeStamp.

This is as basic a "Touch" program as you'll find. Just enter in the offset in days, hours and minutes (positive will push file times into the future, negative into the past), select your files, then hit "Go". Simple.

Each file selected (either a single file or a complete directory tree) has it's "Last Modified" time set to the current time plus the offset that you choose.

The program remembers the last offset you've set, the last 10 files and directories you've stamped, and it's last screen location.

Thanks to:

  • Chris Losinger - Drop Edit
  • Vladimir Kvashin, Girish Bharadwaj and Lars Klose - Directory picker class
  • Davide Calibro - Flat buttons

History

  • 15 July 2009 - Added ability to set file times relative to the original file's time. Also compiles in VC9.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder CodeProject
Canada Canada
Chris Maunder is the co-founder of CodeProject and ContentLab.com, and has been a prominent figure in the software development community for nearly 30 years. Hailing from Australia, Chris has a background in Mathematics, Astrophysics, Environmental Engineering and Defence Research. His programming endeavours span everything from FORTRAN on Super Computers, C++/MFC on Windows, through to to high-load .NET web applications and Python AI applications on everything from macOS to a Raspberry Pi. Chris is a full-stack developer who is as comfortable with SQL as he is with CSS.

In the late 1990s, he and his business partner David Cunningham recognized the need for a platform that would facilitate knowledge-sharing among developers, leading to the establishment of CodeProject.com in 1999. Chris's expertise in programming and his passion for fostering a collaborative environment have played a pivotal role in the success of CodeProject.com. Over the years, the website has grown into a vibrant community where programmers worldwide can connect, exchange ideas, and find solutions to coding challenges. Chris is a prolific contributor to the developer community through his articles and tutorials, and his latest passion project, CodeProject.AI.

In addition to his work with CodeProject.com, Chris co-founded ContentLab and DeveloperMedia, two projects focussed on helping companies make their Software Projects a success. Chris's roles included Product Development, Content Creation, Client Satisfaction and Systems Automation.

Comments and Discussions

 
AnswerVisual Strudio deployment bug Pin
paul kompin8-Jun-12 10:27
paul kompin8-Jun-12 10:27 
GeneralRe: Visual Strudio deployment bug Pin
Chris Maunder11-Jun-12 16:23
cofounderChris Maunder11-Jun-12 16:23 
GeneralThis is exactly the tool... Pin
LastZolex11-Mar-10 1:02
LastZolex11-Mar-10 1:02 
GeneralJust sayin' thanks Pin
paul curthoys28-Dec-09 13:19
paul curthoys28-Dec-09 13:19 
GeneralMissing afxpriv.h Pin
BrianCharles20-Jul-09 8:45
BrianCharles20-Jul-09 8:45 
Generaloffset the timestamp using original value ... Pin
Gert3d15-Jul-09 2:34
Gert3d15-Jul-09 2:34 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 3:32
cofounderChris Maunder15-Jul-09 3:32 
GeneralRe: offset the timestamp using original value ... Pin
Gert3d15-Jul-09 4:02
Gert3d15-Jul-09 4:02 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 4:49
cofounderChris Maunder15-Jul-09 4:49 
GeneralRe: offset the timestamp using original value ... Pin
Gert3d15-Jul-09 21:28
Gert3d15-Jul-09 21:28 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 21:51
cofounderChris Maunder15-Jul-09 21:51 
GeneralRe: offset the timestamp using original value ... [modified] Pin
Gert3d15-Jul-09 23:41
Gert3d15-Jul-09 23:41 
GeneralUse modified Timestamp for foto-file synchronization Pin
jeroen van dael12-Dec-06 2:12
jeroen van dael12-Dec-06 2:12 
QuestionAdd 12 hours to *existing* time stamp? Pin
rcblanchard26-Dec-04 3:55
rcblanchard26-Dec-04 3:55 
AnswerRe: Add 12 hours to *existing* time stamp? Pin
The Chrisman27-Feb-06 8:02
The Chrisman27-Feb-06 8:02 
GeneralRe: Add 12 hours to *existing* time stamp? Pin
kwestman11-Jul-06 6:31
kwestman11-Jul-06 6:31 
GeneralRe: Add 12 hours to *existing* time stamp? Pin
Psinewave20-Aug-06 15:53
Psinewave20-Aug-06 15:53 
Questionchange created date of file? Pin
ngtrungthanh14-Apr-04 2:12
ngtrungthanh14-Apr-04 2:12 
AnswerRe: change created date of file? Pin
ifbn31-Aug-04 18:05
ifbn31-Aug-04 18:05 
GeneralRe: change created date of file? Pin
James Duy Trinh (VietDoor)8-Dec-05 16:42
James Duy Trinh (VietDoor)8-Dec-05 16:42 
Generaltimestamp Pin
dazzavazza27-Mar-03 3:09
dazzavazza27-Mar-03 3:09 
Generaldirectory's date/time Pin
Piccinano11-Dec-02 23:06
Piccinano11-Dec-02 23:06 
GeneralRe: directory's date/time Pin
wct12-Oct-10 17:48
wct12-Oct-10 17:48 
GeneralAlas useful... Pin
Pierre Couderc3-Dec-02 6:54
Pierre Couderc3-Dec-02 6:54 
GeneralYou can do this already with an excellent Shell Extension - PropertiesPlus 1.65 Pin
me1012-Dec-02 12:50
me1012-Dec-02 12:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.