summaryrefslogtreecommitdiffstats
path: root/bin/ps
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ps')
-rw-r--r--bin/ps/print.c9
-rw-r--r--bin/ps/ps.14
2 files changed, 4 insertions, 9 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c
index bcd451e..40ecd07 100644
--- a/bin/ps/print.c
+++ b/bin/ps/print.c
@@ -383,7 +383,6 @@ started(KINFO *k, VARENT *ve __unused)
{
time_t then;
struct tm *tp;
- static int use_ampm = -1;
size_t buflen = 100;
char *buf;
@@ -394,16 +393,12 @@ started(KINFO *k, VARENT *ve __unused)
if (buf == NULL)
errx(1, "malloc failed");
- if (use_ampm < 0)
- use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0');
then = k->ki_p->ki_start.tv_sec;
tp = localtime(&then);
if (now - k->ki_p->ki_start.tv_sec < 24 * 3600) {
- (void)strftime(buf, buflen,
- use_ampm ? "%l:%M%p" : "%k:%M ", tp);
+ (void)strftime(buf, buflen, "%H:%M ", tp);
} else if (now - k->ki_p->ki_start.tv_sec < 7 * 86400) {
- (void)strftime(buf, buflen,
- use_ampm ? "%a%I%p" : "%a%H ", tp);
+ (void)strftime(buf, buflen, "%a%H ", tp);
} else
(void)strftime(buf, buflen, "%e%b%y", tp);
return (buf);
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 7e26dd9..6eead76 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -381,12 +381,12 @@ the real memory (resident set) size of the process (in 1024 byte units).
The time the command started.
If the command started less than 24 hours ago, the start time is
displayed using the
-.Dq Li %l:ps.1p
+.Dq Li %H:%M
format described in
.Xr strftime 3 .
If the command started less than 7 days ago, the start time is
displayed using the
-.Dq Li %a6.15p
+.Dq Li %a%H
format.
Otherwise, the start time is displayed using the
.Dq Li %e%b%y
OpenPOWER on IntegriCloud