tar - time stamp is in the future

By xngo on April 27, 2020

I was compressing a folder with a lot of files using tar and then when I untar it, it threw the following warning message.

tar: .: time stamp 2299-01-26 19:36:45 is 8796473213.075044639 s in the future

Solution

I searched the internet for the solution. They all raise the issue that my system clock and timezone are not correct. I checked my system clock and it is displaying the correct date and time. Later, I checked the time stamp of all the files that I want to compress, some of them have the year 2299. I decided to change those files to today's date.

find . -exec touch -am '{}' \;
  • -a: change only the access time
  • -m: change only the modification time

Or, you can suppress the warning message when you untar your archive file.

tar xzf archive.tar --warning=no-timestamp

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.