[Bug 257075] touch(1) does not accept input from date(1) with -I to -d

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 09 Jul 2021 08:23:03 UTC

            Bug ID: 257075
           Summary: touch(1) does not accept input from date(1) with -I to
           Product: Base System
           Version: 12.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: michael.osipov@siemens.com

Running on stable/12:4e2ae05c3

I am trying to set the mtime of a file in the future to trick make.

# ahead_of_time="$(date -v +2S -Iseconds)"
# echo $ahead_of_time
# touch -d "$ahead_of_time" .
touch: out of range or illegal time specification:

Although tz is documented as:
                   tz      An optional letter Z indicating the time is in UTC.
                           Otherwise, the time is assumed to be in local time.
                           Local time is affected by the value of the TZ
                           environment variable.

It is confusing in many ways:
* I cannot reuse default values produced by tools from base
* tz is not a TZ, but rather Zulu only and should rather say in the pattern:

A much better approach would be if -d would parse properly extended ISO 8601
format as spit out by date -I and documented as such -- accepting any offset.

You are receiving this mail because:
You are the assignee for the bug.