|
2014-05-13
| ||
| 11:25 | [958bc05fbe]: Clarify "clock format" using "%R" check-in: b5de46ac73 user: jan.nijtmans tags: trunk | |
| 11:23 | [958bc05fbe]: Clarify "clock format" using "%R" check-in: 1e1b95e0e6 user: jan.nijtmans tags: core-8-5-branch | |
| 11:21 | • Closed ticket [958bc05fbe]: "clock format" with "%R" and &qu... artifact: 0f49800e7d user: jan.nijtmans | |
| 07:45 | • New ticket [958bc05fbe]. artifact: 9033833640 user: Martin0815 | |
"clock format" with "%R" and "%r" mismatch
Closed / Fixed958bc05fbe38c74f73589eb48522a5ea8d96cc4aCreated 13 years agoUpdated 13 years ago
Descriptionhtml2014-05-13 07:45:45
Bug
The bug is, that the%r (AM/PM) clock format result contains seconds, while the format result with %R does not contain seconds.
Excerpt from the docs:
- %r
- On output, produces a locale-dependent time of day representation on a 12-hour clock. On input, accepts whatever %r produces.
- %R
- On output, produces a locale-dependent time of day representation on a 24-hour clock. On input, accepts whatever %R produces.
Example code:
% info patch
8.6.1
% set secs 986140861
986140861
% clock format $secs -format %R
18:01
% clock format $secs -format %r
06:01:01 pm
Referenced by2
b5de46ac73[958bc05fbe]: Clarify "clock format" using "%R" check-in2014-05-13 11:25:261e1b95e0e6[958bc05fbe]: Clarify "clock format" using "%R" check-in2014-05-13 11:23:40
jan.nijtmanswiki2014-05-13 11:21:55
Since Tcl's implementation corresponds with UNIX's strftime() function:
http://man7.org/linux/man-pages/man3/strftime.3.html
%r The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to %I:%M:%S %p. (SU)
%R The time in 24-hour notation (%H:%M). (SU) For a version including the seconds, see %T below.
So, this is merely a documentation bug than an implementation bug. Fixed now.
Thanks!
Log in (anonymous is fine) to add a comment.