From 61c0414a60385ff3a1ca439741769568391da4c7 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 31 Mar 1996 16:39:26 +0000 Subject: Localize time --- usr.bin/systat/main.c | 3 +++ usr.bin/systat/vmstat.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'usr.bin/systat') diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c index 69523c9..78dd716 100644 --- a/usr.bin/systat/main.c +++ b/usr.bin/systat/main.c @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #include +#include #include #include #include @@ -82,6 +83,8 @@ main(argc, argv) { char errbuf[80]; + (void) setlocale(LC_TIME, ""); + argc--, argv++; while (argc > 0) { if (argv[0][0] == '-') { diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 77fe924..bfbde6c 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -59,6 +59,7 @@ static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94"; #include #include #include +#include #include #include "systat.h" #include "extern.h" @@ -263,9 +264,11 @@ void fetchkre() { time_t now; + struct tm *tp; time(&now); - strcpy(buf, ctime(&now)); + tp = localtime(&now); + (void) strftime(buf, sizeof(buf), "%c", tp); buf[16] = '\0'; getinfo(&s, state); } -- cgit v1.1