How to Change File Timestamp in Linux
We may get a warning from the complile that "make: warning: Clock skew detected. Your build may be incomplete.". That says we need to change the file timestamp to a correct value. There are two methods to accomplish it. I test these samples in Ubuntu 14.04 LTS.
1. Open and resave it
If the file is a simple text or a document with serveral numbers, eg, *.mk, *.doc, *.txt, *.java, *.cpp, etc, you can open and resave it, Linux will update the timestamp automatically.
If it is a binary file or if you have too many files pending to change, even some sub-folders included, you must look forward to some other ways.
2. Using touch to change timestamp
Running these examples in your command prompt.
Change file sample.mk modified time to 2013-07-20 11:22:03
touch -m -d "2013-07-20 11:22:03" sample.mk
Change file accessed and modified time to 2013-07-20 11:22:03
touch -d "2013-07-20 11:22:03" sample.mk
Change all *.hex files timestamp to current time
For more information: