mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Localize time
This commit is contained in:
parent
3cb7c0b144
commit
daab85586e
2 changed files with 7 additions and 1 deletions
|
|
@ -43,6 +43,7 @@ static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
|
|||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <locale.h>
|
||||
#include <nlist.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
|
@ -82,6 +83,8 @@ main(argc, argv)
|
|||
{
|
||||
char errbuf[80];
|
||||
|
||||
(void) setlocale(LC_TIME, "");
|
||||
|
||||
argc--, argv++;
|
||||
while (argc > 0) {
|
||||
if (argv[0][0] == '-') {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
|
|||
#include <paths.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue