View Issue Details

IDProjectCategoryView StatusLast Update
00019911003.1(2024)/Issue8Shell and Utilitiespublic2026-07-13 09:13
Reportereggert Assigned To 
PrioritylowSeverityObjectionTypeError
Status Interpretation RequiredResolutionAccepted As Marked 
NamePaul Eggert
OrganizationUCLA Computer Science Department
User Referencetouch0001
Sectiontouch
Page Number3451
Line Number117731
Interp StatusProposed
Final Accepted TextBugnote:0007748
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.
Tagstc1-2024

Activities

agadmin

2026-07-09 15:52

administrator   bugnote:0007448

Interpretation response
------------------------
The standard clearly states the format for the -d option to the touch utility , and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
The standard did not intend to require implementations to implement timestamps in a way that disagrees with ISO 8601. Although some implementations treat ":60" as meaning the first second of the next minute, this behavior should not be required.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the suggested change as noted in the bug report

agadmin

2026-07-13 09:13

administrator   bugnote:0007452

Interpretation Proposed: 13 July 2026

Issue History

Date Modified Username Field Change
2026-06-30 05:43 eggert New Issue
2026-07-09 15:52 agadmin Status New => Resolved
2026-07-09 15:52 agadmin Resolution Open => Accepted As Marked
2026-07-09 15:52 agadmin Note Added: 0007448
2026-07-09 15:53 agadmin Final Accepted Text => Bugnote:0007748
2026-07-09 15:54 agadmin Status Resolved => Interpretation Required
2026-07-09 16:10 agadmin Tag Attached: tc1-2024
2026-07-09 16:11 agadmin Final Accepted Text Bugnote:0007748 => bugnote:7748
2026-07-09 16:12 agadmin Final Accepted Text bugnote:7748 => see bugnote:7748
2026-07-09 16:16 agadmin Final Accepted Text see bugnote:7748 =>
2026-07-09 16:21 agadmin Project Issue 8 drafts => 1003.1(2024)/Issue8
2026-07-09 16:22 agadmin Interp Status => Pending
2026-07-09 16:22 agadmin Final Accepted Text => Bugnote:0007748
2026-07-13 09:13 agadmin Interp Status Pending => Proposed
2026-07-13 09:13 agadmin Note Added: 0007452