-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
touch: -t
YYMMDDhhmm leads to incorrect year if YY > 68
#7280
Comments
That's a very specific issue there 🧐 I'm curious of why did GNU decided to change the behavior between 68-69 specifically |
I don't know what the reason is but the behavior is documented:
My guess is that it is related to its obsolete syntax:
|
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
I've attempted a fix in #7378 |
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
When using `touch -t` with a 2 digit year, the year is interpreted as a relative year to 2000. When the year is 68 or less, it should be interpreted as 20xx. When the year is 69 or more, it should be interpreted as 19xx. This is the behavior of GNU `touch`. fixes uutilsgh-7280 Arguably 2 digits years should be deprecated as we are already closer to 2069, than 1969.
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: