Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Jul 2021 08:23:03 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 257075] touch(1) does not accept input from date(1) with -I to -d
Message-ID:  <bug-257075-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D257075

            Bug ID: 257075
           Summary: touch(1) does not accept input from date(1) with -I to
                    -d
           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=3D"$(date -v +2S -Iseconds)"
# echo $ahead_of_time
2021-07-09T10:17:08+02:00
# touch -d "$ahead_of_time" .
touch: out of range or illegal time specification:
YYYY-MM-DDThh:mm:SS[.frac][tz]

Although tz is documented as:
                   tz      An optional letter Z indicating the time is in U=
TC.
                           Otherwise, the time is assumed to be in local ti=
me.
                           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:
YYYY-MM-DDThh:mm:SS[.frac][Z]

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 offse=
t.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257075-227>