* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
static char sccsid
[] = "@(#)get_date.c 5.2 (Berkeley) 10/22/87";
"Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"
static char *months
[] = {
"Jan", "Feb", "Mar", "Apr", "May", "June",
"July", "Aug", "Sept", "Oct", "Nov", "Dec"
struct tm
*localtime(), *tmp
;
tmp
= localtime(&tv
.tv_sec
);
zone
= AM
; /* default to morning */
realhour
= 12; /* midnight */
else if (tmp
->tm_hour
== 12)
else if (tmp
->tm_hour
>= 13 && tmp
->tm_hour
<= 23) { /* afternoon */
realhour
= realhour
- 12;
/* format is '8:10pm on Sunday, 16 Sept 1973' */
(void)sprintf(datebuffer
, "%d:%02d%s on %s, %d %s %d",