From: Prateek saxena Date: Thu, 11 May 2017 11:46:02 +0000 (+0100) Subject: uptime: remove inconsistent AM/PM from current time X-Git-Tag: v8.28~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82911c51aef32702abde676241b75d4f25d94812;p=thirdparty%2Fcoreutils.git uptime: remove inconsistent AM/PM from current time * src/uptime.c (main): 00-23 was always used for the hour component of the current time, so remove the AM/PM output (which was only present in some locales anyway). Also add seconds to the time to be more consistent with the usual procps-ng uptime implementation on GNU/Linux. * NEWS: Mention the fix. Fixes http://bugs.gnu.org/26783 --- diff --git a/NEWS b/NEWS index 30ec6f8660..559bcb3778 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,10 @@ GNU coreutils NEWS -*- outline -*- tail -F 'dir/file' is now monitored even when 'dir' is replaced. [bug introduced with inotify support added in coreutils-7.5] + uptime no longer outputs the AM/PM component of the current time, + as that's inconsistent with the 24 hour time format used. + [bug introduced in coreutils-7.0] + ** New features expand and unexpand now support specifying an offset for tab stops diff --git a/src/uptime.c b/src/uptime.c index f6aef6bda7..08e45a8ff1 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -134,7 +134,7 @@ print_uptime (size_t n, const STRUCT_UTMP *this) previous versions of coreutils don't. */ if (tmn) /* TRANSLATORS: This prints the current clock time. */ - fprintftime (stdout, _(" %H:%M%P "), tmn, 0, 0); + fprintftime (stdout, _(" %H:%M:%S "), tmn, 0, 0); else printf (_(" ??:???? ")); if (uptime == (time_t) -1)