-1

I want to change all files in directory creation/modification date to 0/0/0.

I tried to use find $PWD -exec touch -m -d '0/0/0' {} + command.

4
  • 1
    UNIX Epoch time starts from 01/01/1970, there is no 0/0/0. Commented Feb 21, 2021 at 18:15
  • 1
    Why is it works at 1/1/1? Commented Feb 21, 2021 at 18:24
  • 1
    What's 0/0/0 supposed to mean? There is no day/month/year 0 (while 1/1/1 does make sense). Commented Feb 21, 2021 at 18:51
  • 1
    This is dependent on file system. Some older file systems have a 32-bit time, giving ISO format 1970-01-01T00:00:00 to 2038-01-19T03:14:07. But ext4 (for example) does a huge range, but still based at 1970, so your "zero" date stores as -62167219125 seconds. TZ/DST info is a bit sparse in that era, so a few hours off can be expected. Commented Feb 21, 2021 at 23:10

1 Answer 1

0

There is no day number 0 in a month and there is no month 0 in a year. Days and months start from 1.

Try one of these instead:

touch -d '1/1/0 0:0' foo touch -t 000001010000 bar 
2
  • I know, but I think it's possible to change creation/modification date to 0/0/0. Commented Feb 22, 2021 at 4:51
  • You thing it's possible nevertheless? This is a good start @ArianKG. Now you've got to give a meaning to a date like 0/0/0, and then to propose patches so that this meaning is understood by commands like date, touch, etc. Commented Feb 22, 2021 at 10:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.