diff options
author | ache <ache@FreeBSD.org> | 2001-03-02 23:53:36 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-02 23:53:36 +0000 |
commit | 0d5efacbf56c92f8d2b3ed41f72b0c928e6efb45 (patch) | |
tree | b1808f8dc48f3c15fda2d81be061757003d8c529 /bin/ps/print.c | |
parent | 98047335baabd6545b20432cdeeed011dcceb61b (diff) | |
download | FreeBSD-src-0d5efacbf56c92f8d2b3ed41f72b0c928e6efb45.zip FreeBSD-src-0d5efacbf56c92f8d2b3ed41f72b0c928e6efb45.tar.gz |
Use AM/PM time only when available in locale
Diffstat (limited to 'bin/ps/print.c')
-rw-r--r-- | bin/ps/print.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/ps/print.c b/bin/ps/print.c index 72d96cf..37d03a3 100644 --- a/bin/ps/print.c +++ b/bin/ps/print.c @@ -366,9 +366,11 @@ started(k, ve) if (!now) (void)time(&now); if (now - k->ki_p->ki_start.tv_sec < 24 * 3600) { - (void)strftime(buf, sizeof(buf) - 1, "%l:%M%p", tp); + (void)strftime(buf, sizeof(buf) - 1, + use_ampm ? "%l:%M%p" : "%k:%M ", tp); } else if (now - k->ki_p->ki_start.tv_sec < 7 * 86400) { - (void)strftime(buf, sizeof(buf) - 1, "%a%I%p", tp); + (void)strftime(buf, sizeof(buf) - 1, + use_ampm ? "%a%I%p" : "%a%H ", tp); } else (void)strftime(buf, sizeof(buf) - 1, "%e%b%y", tp); (void)printf("%-*s", v->width, buf); |