diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 817cc2582fec..2e0376ef9f93 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -53,6 +53,7 @@ static char sccsid[] = "@(#)pr.c 8.2 (Berkeley) 4/16/94"; #include #include +#include #include #include #include @@ -1577,6 +1578,7 @@ setup(argc, argv) register char **argv; { register int c; + int d_first; int eflag = 0; int iflag = 0; int wflag = 0; @@ -1818,8 +1820,10 @@ setup(argc, argv) } } - timefrmt = TIMEFMT; (void) setlocale(LC_TIME, (Lflag != NULL) ? Lflag : ""); + d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); + timefrmt = d_first ? TIMEFMTD : TIMEFMTM; + return(0); } diff --git a/usr.bin/pr/pr.h b/usr.bin/pr/pr.h index f132675e5aea..a4346c788dcc 100644 --- a/usr.bin/pr/pr.h +++ b/usr.bin/pr/pr.h @@ -59,7 +59,8 @@ #define HDFMT "%s %s Page %d\n\n\n" #define HEADLEN 5 #define TAILLEN 5 -#define TIMEFMT "%Ef %H:%M %Y" +#define TIMEFMTD "%e %b %H:%M %Y" +#define TIMEFMTM "%b %e %H:%M %Y" #define FNAME "" #define LBUF 8192 #define HDBUF 512