diff options
author | ache <ache@FreeBSD.org> | 2001-03-02 23:11:38 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2001-03-02 23:11:38 +0000 |
commit | fe36abf2a2f077438e6508f74d8aab0ef94f3407 (patch) | |
tree | 86b80a29b14392eaa125a314a4bdce2acc853b75 /usr.bin/w/pr_time.c | |
parent | 1f9d1d9ad2bc748fd0af7770e0100696ec49600e (diff) | |
download | FreeBSD-src-fe36abf2a2f077438e6508f74d8aab0ef94f3407.zip FreeBSD-src-fe36abf2a2f077438e6508f74d8aab0ef94f3407.tar.gz |
Use AM/PM time only when available in locale
Diffstat (limited to 'usr.bin/w/pr_time.c')
-rw-r--r-- | usr.bin/w/pr_time.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/w/pr_time.c b/usr.bin/w/pr_time.c index 4b9614c..30afc10 100644 --- a/usr.bin/w/pr_time.c +++ b/usr.bin/w/pr_time.c @@ -50,9 +50,6 @@ static const char rcsid[] = /* * pr_attime -- * Print the time since the user logged in. - * - * Note: SCCS forces the bizarre string manipulation, things like - * 8.2 get replaced in the source code. */ void pr_attime(started, now) @@ -77,12 +74,12 @@ pr_attime(started, now) tm.tm_year != tp.tm_year) { /* The line below does not take DST into consideration */ /* else if (*now / 86400 != *started / 86400) { */ - (void)strcpy(fmt, __CONCAT("%a%", "I%p")); + (void)strcpy(fmt, use_ampm ? "%a%I%p" : "%a%H "); } /* Default is hh:mm{am,pm}. */ else { - (void)strcpy(fmt, __CONCAT("%l:%", "M%p")); + (void)strcpy(fmt, use_ampm ? "%l:%M%p" : "%k:%M "); } (void)strftime(buf, sizeof(buf) - 1, fmt, &tp); |