Click here to Skip to main content
11,434,743 members (47,498 online)
Click here to Skip to main content

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

, 15 Jul 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
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)

Share

About the Author

Chris Maunder
Founder CodeProject
Canada Canada
Chris is the Co-founder, Administrator, Architect, Chief Editor and Shameless Hack who wrote and runs The Code Project. He's been programming since 1988 while pretending to be, in various guises, an astrophysicist, mathematician, physicist, hydrologist, geomorphologist, defence intelligence researcher and then, when all that got a bit rough on the nerves, a web developer. He is a Microsoft Visual C++ MVP both globally and for Canada locally.

His programming experience includes C/C++, C#, SQL, MFC, ASP, ASP.NET, and far, far too much FORTRAN. He has worked on PocketPCs, AIX mainframes, Sun workstations, and a CRAY YMP C90 behemoth but finds notebooks take up less desk space.

He dodges, he weaves, and he never gets enough sleep. He is kind to small animals.

Chris was born and bred in Australia but splits his time between Toronto and Melbourne, depending on the weather. For relaxation he is into road cycling, snowboarding, rock climbing, and storm chasing.
Follow on   Twitter   Google+   LinkedIn

Comments and Discussions

 
AnswerVisual Strudio deployment bug Pin
paul kompin8-Jun-12 11:27
memberpaul kompin8-Jun-12 11:27 
GeneralRe: Visual Strudio deployment bug Pin
Chris Maunder11-Jun-12 17:23
adminChris Maunder11-Jun-12 17:23 
GeneralThis is exactly the tool... Pin
LastZolex11-Mar-10 2:02
memberLastZolex11-Mar-10 2:02 
GeneralJust sayin' thanks Pin
paul curthoys28-Dec-09 14:19
memberpaul curthoys28-Dec-09 14:19 
GeneralMissing afxpriv.h Pin
BrianCharles20-Jul-09 9:45
memberBrianCharles20-Jul-09 9:45 
Generaloffset the timestamp using original value ... Pin
Gert3d15-Jul-09 3:34
memberGert3d15-Jul-09 3:34 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 4:32
adminChris Maunder15-Jul-09 4:32 
GeneralRe: offset the timestamp using original value ... Pin
Gert3d15-Jul-09 5:02
memberGert3d15-Jul-09 5:02 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 5:49
adminChris Maunder15-Jul-09 5:49 
GeneralRe: offset the timestamp using original value ... Pin
Gert3d15-Jul-09 22:28
memberGert3d15-Jul-09 22:28 
GeneralRe: offset the timestamp using original value ... Pin
Chris Maunder15-Jul-09 22:51
adminChris Maunder15-Jul-09 22:51 
GeneralRe: offset the timestamp using original value ... [modified] Pin
Gert3d16-Jul-09 0:41
memberGert3d16-Jul-09 0:41 
GeneralUse modified Timestamp for foto-file synchronization Pin
jeroen van dael12-Dec-06 3:12
memberjeroen van dael12-Dec-06 3:12 
QuestionAdd 12 hours to *existing* time stamp? Pin
rcblanchard26-Dec-04 4:55
memberrcblanchard26-Dec-04 4:55 
AnswerRe: Add 12 hours to *existing* time stamp? Pin
The Chrisman27-Feb-06 9:02
memberThe Chrisman27-Feb-06 9:02 
GeneralRe: Add 12 hours to *existing* time stamp? Pin
kwestman11-Jul-06 7:31
memberkwestman11-Jul-06 7:31 
GeneralRe: Add 12 hours to *existing* time stamp? Pin
Psinewave20-Aug-06 16:53
memberPsinewave20-Aug-06 16:53 
Questionchange created date of file? Pin
ngtrungthanh14-Apr-04 3:12
memberngtrungthanh14-Apr-04 3:12 
AnswerRe: change created date of file? Pin
ifbn31-Aug-04 19:05
memberifbn31-Aug-04 19:05 
GeneralRe: change created date of file? Pin
meouvn8-Dec-05 17:42
membermeouvn8-Dec-05 17:42 
Generaltimestamp Pin
dazzavazza27-Mar-03 4:09
memberdazzavazza27-Mar-03 4:09 
Generaldirectory's date/time Pin
Peppe12-Dec-02 0:06
memberPeppe12-Dec-02 0:06 
GeneralRe: directory's date/time Pin
wct12-Oct-10 18:48
memberwct12-Oct-10 18:48 
GeneralAlas useful... Pin
Pierre Couderc3-Dec-02 7:54
memberPierre Couderc3-Dec-02 7:54 
GeneralYou can do this already with an excellent Shell Extension - PropertiesPlus 1.65 Pin
me1012-Dec-02 13:50
memberme1012-Dec-02 13:50 
GeneralRe: You can do this already with an excellent Shell Extension - PropertiesPlus 1.65 Pin
Philippe Lhoste2-Dec-02 23:31
memberPhilippe Lhoste2-Dec-02 23:31 
GeneralRe: You can do this already with an excellent Shell Extension - PropertiesPlus 1.65 Pin
kajjo3-Aug-03 14:00
susskajjo3-Aug-03 14:00 
GeneralOh man Pin
Jörgen Sigvardsson27-Nov-02 15:05
memberJörgen Sigvardsson27-Nov-02 15:05 
GeneralRe: Oh man Pin
Chris Maunder28-Nov-02 7:17
adminChris Maunder28-Nov-02 7:17 
GeneralA different use of this tool Pin
Anonymously27-Nov-02 7:45
sussAnonymously27-Nov-02 7:45 
GeneralRe: A different use of this tool Pin
rahtrow29-May-03 3:34
memberrahtrow29-May-03 3:34 
GeneralDamn fast Pin
Paul Ingles27-Nov-02 6:10
memberPaul Ingles27-Nov-02 6:10 
GeneralRe: Damn fast Pin
Paul Watson27-Nov-02 6:23
sitebuilderPaul Watson27-Nov-02 6:23 
GeneralRe: Damn fast Pin
Thomas Freudenberg27-Nov-02 7:09
memberThomas Freudenberg27-Nov-02 7:09 
GeneralRe: Damn fast Pin
Paul Ingles27-Nov-02 7:15
memberPaul Ingles27-Nov-02 7:15 
GeneralRe: Damn fast - minor update Pin
Paul Ingles29-Nov-02 0:59
memberPaul Ingles29-Nov-02 0:59 
GeneralRe: Damn fast - minor update - Version 2 (ish) Pin
Paul Ingles29-Dec-02 8:27
memberPaul Ingles29-Dec-02 8:27 
GeneralHelpful for timebomb sharewares Pin
.S.Rod.27-Nov-02 5:58
member.S.Rod.27-Nov-02 5:58 
GeneralRe: Helpful for timebomb sharewares Pin
Christian Graus27-Nov-02 18:07
memberChristian Graus27-Nov-02 18:07 
GeneralBest of breed Pin
Tom Archer27-Nov-02 5:33
memberTom Archer27-Nov-02 5:33 
GeneralRe: Best of breed Pin
Brian Delahunty27-Nov-02 5:47
editorBrian Delahunty27-Nov-02 5:47 
GeneralRe: Best of breed Pin
Tom Archer27-Nov-02 6:57
memberTom Archer27-Nov-02 6:57 
GeneralRe: Best of breed Pin
Chris Maunder27-Nov-02 7:27
adminChris Maunder27-Nov-02 7:27 
GeneralRe: Best of breed Pin
Brian Delahunty28-Nov-02 4:33
editorBrian Delahunty28-Nov-02 4:33 
GeneralRe: Best of breed Pin
Tom Archer28-Nov-02 4:59
memberTom Archer28-Nov-02 4:59 
GeneralRe: Best of breed Pin
Richard Jones28-Nov-02 10:13
memberRichard Jones28-Nov-02 10:13 
GeneralRe: Best of breed Pin
Tom Archer28-Nov-02 14:08
memberTom Archer28-Nov-02 14:08 
GeneralRe: Best of breed Pin
Chris Maunder30-Nov-02 8:20
adminChris Maunder30-Nov-02 8:20 
GeneralRe: Best of breed Pin
Ravi Bhavnani27-Nov-02 11:06
memberRavi Bhavnani27-Nov-02 11:06 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150428.2 | Last Updated 15 Jul 2009
Article Copyright 2002 by Chris Maunder
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid