Skip to content

touch: -t YYMMDDhhmm leads to incorrect year if YY > 68 #7280

Closed
@cakebaker

Description

@cakebaker

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions