Touch(1) avoids 28 March 1993

touch(1) seems to try hard to avoid the date 28 March 1993:

iad@iad:~$ touch test
iad@iad:~$ ll test
-rw-r--r-- 1 iad iad 0 Jan 28 10:40 test
iad@iad:~$ touch -d 'Mar 27 1993' test
iad@iad:~$ ll test
-rw-r--r-- 1 iad iad 0 Mar 27  1993 test
iad@iad:~$ touch -d 'Mar 28 1993' test
touch: invalid date format ‘Mar 28 1993’
iad@iad:~$ touch -d 'Mar 28 1994' test
iad@iad:~$ touch -r test -d '1 year ago' test
iad@iad:~$ ll test
-rw-r--r-- 1 iad iad 0 Mar 27  1993 test
iad@iad:~$ touch -r test -d '1 day' test
iad@iad:~$ ll test
-rw-r--r-- 1 iad iad 0 Mar 29  1993 test

What is going on? Is the date 28 March 1993 considered holy or foul? What happened then?

(This behaviour was seen on three computers running Linux Mint, Ubuntu and Linux Lite.)

—Ivan A Derzhanski

Very interesting. I guess you might want to create an issue on their git page to make this weird bug public.

I tested it on my system and it worked just fine. So I am curious why it’s not working for you.

1 Like

I just did this on my system and didnt have any problem either – other than its formatted a bit strange:
wys@sys:~/www/Testing$ touch -d ‘Mar 28 1993’ test2
wys@sys:~/www/Testing$ ll test2
-rw-rw-r-- 1 wys sys 0 Mar 28 1993 test2

Adds in a extra space after the 8 on the date - other than that it seems to work fine here.

1 Like

I’m curious too, especially because (as I said) I’m getting the same effect on three computers, which run different (albeit related) Linux systems.

Never mind the formatting, the point is that I get a very different response to ‘28 Mar 1993’ and to ‘27 Mar 1993’ or ‘28 Mar 1994’. What distribution did you try it on?

One computer is Ubuntu 16.04, Kubuntu 18.04, and KDE 18.04

1 Like

So it’s not up to the distribution (one of mine is also Ubuntu 16.04). Curiouser and curiouser.

1 Like

Just tested it on Ubuntu 18.04, and CentOS 7, not seeing this anomaly…

Tried both ‘Mar 28 1993’ and ‘28 Mar 1993’

So I figured that if I get this effect on all my computers and none of you can replicate it, then either I’m jinxed or this has something to do with my location (and then other people may be able to obtain it with other dates). Querying Google for ‘touch: invalid date format’ without specifying my date this time, I found this.
Briefly, where I sit, touch(1) avoids 28 March 1993 because it expands this to 00:00:00 on that date, and as far as it knows, no such time ever existed in my time zone due to daylight saving time. For the same reason I can’t touch a file to 27 March 1994, 26 March 1995 or 31 March 1996. The dates are accepted, however, if 01:00:00 or a later time is added.
With later years touch(1) thinks that the missing hour was from 03:00:00 to 03:59:59, so I can touch a file to 30 March 1997 (not naming the time), but not to 03:00:00 on that date.

3 Likes

That’s a new thing I learned today, thanks to you.