You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a two-digit year is specified with -t, GNU touch uses the 19-prefix if the year is greater than 68, whereas uutils touch uses 20.
$ touch -t 6801010000 a
$ ls -l a
-rw-r--r-- 1 dho dho 0 Jan 1 2068 a
$ touch -t 6901010000 a
$ ls -l a
-rw-r--r-- 1 dho dho 0 Jan 1 1969 a
$ cargo run -q touch -t 6801010000 a
$ ls -l a
-rw-r--r-- 1 dho dho 0 Jan 1 2068 a
$ cargo run -q touch -t 6901010000 a
$ ls -l a
-rw-r--r-- 1 dho dho 0 Jan 1 2069 a
The text was updated successfully, but these errors were encountered:
I don't know what the reason is but the behavior is documented:
If the year is specified with only two digits, then cc is 20 for years in the range 0 … 68, and 19 for years in 69 … 99.
My guess is that it is related to its obsolete syntax:
[...] if there are two or more files and the first file is of the form ‘mmddhhmm[yy]’ and this would be a valid argument to the -t option (if the yy, if any, were moved to the front), and if the represented year is in the range 1969–1999, that argument is interpreted as the time for the other files instead of as a file name.
If a two-digit year is specified with
-t
, GNUtouch
uses the19
-prefix if the year is greater than68
, whereas uutilstouch
uses20
.The text was updated successfully, but these errors were encountered: