View Issue Details

IDProjectCategoryView StatusLast Update
0001991Issue 8 draftsShell and Utilitiespublic2026-06-30 05:43
Reportereggert Assigned To 
PrioritylowSeverityObjectionTypeError
Status NewResolutionOpen 
NamePaul Eggert
OrganizationUCLA Computer Science Department
User Referencetouch0001
Sectiontouch
Page Number3451
Line Number117731
Final Accepted Text
Summary0001991: touch -d 2026-06-29T00:00:60 should not be required to succeed
DescriptionThe POSIX spec for 'touch' (POSIX.1-2024 page 3451 line 117731) specifies an option -d whose argument uses ISO 8601 notation to specify the time. However, if read literally there is a disagreement with ISO 8601 that I believe is unintentional, and which causes GNU coreutils 'touch' to fail to conform.

The apparent disagreement was introduced in POSIX.1-2017, when -d was added with ISO 8601 syntax, but with semantics that seem to defer to the longstanding -t option in the treatment of the seconds (SS) field, namely, if SS is 60 that should mean the first second of the next minute. This meaning for SS contradicts ISO 8601, which says an SS value of 60 can only mean a leap second.

I expect this disagreement with ISO 8601 was unintentional. Furthermore, the disagreement disagrees with GNU 'touch', which reserves SS=60 for true leap seconds which exist on (non-POSIX) platforms that support leap seconds.

GNU 'touch' takes the not unreasonable position that it is helpful to catch typos, such as hours, minutes or seconds that are out of ISO 8601 range. POSIX surely did not intend to require implementations to implement timestamps in a way that disagrees with ISO 8601. Although some implementations, such as FreeBSD 'touch', treat ":60" as meaning the first second of the next minute, this behavior should not be required.
Desired ActionOn page page 3451 line 117731, change:

MM, DD, hh, mm, and SS are as with −t time.

to:

MM, DD, hh, mm, and SS are as with −t time, except that behavior is unspecified if SS is 60.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-06-30 05:43 eggert New Issue