xref: /original-bsd/old/dbx/mkdate.c (revision 91abda3c)
1 /*
2  * Copyright (c) 1983 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #ifndef lint
9 char copyright[] =
10 "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
11  All rights reserved.\n";
12 #endif /* not lint */
13 
14 #ifndef lint
15 static char sccsid[] = "@(#)mkdate.c	5.5 (Berkeley) 06/01/90";
16 #endif /* not lint */
17 
18 #include <stdio.h>
19 #ifdef IRIS
20 #   include <time.h>
21 #else
22 #   include <sys/time.h>
23 #endif
24 
25 main()
26 {
27     struct tm *t;
28     long clock;
29     char name[100];
30     int namelen;
31 
32     printf("char *date = \"");
33     clock = time(0);
34     t = localtime(&clock);
35     printf("%d/%d/%d ", t->tm_mon + 1, t->tm_mday, t->tm_year % 100);
36     printf("%d:%02d", t->tm_hour, t->tm_min);
37 #   ifndef IRIS
38 	gethostname(name, &namelen);
39 	printf(" (%s)", name);
40 #   endif
41     printf("\";\n");
42     exit(0);
43 }
44