xref: /csrg-svn/old/dbx/mkdate.c (revision 42683)
121612Sdist /*
238105Sbostic  * Copyright (c) 1983 The Regents of the University of California.
338105Sbostic  * All rights reserved.
438105Sbostic  *
5*42683Sbostic  * %sccs.include.redist.c%
621612Sdist  */
711802Slinton 
821612Sdist #ifndef lint
938105Sbostic char copyright[] =
1038105Sbostic "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
1138105Sbostic  All rights reserved.\n";
1238105Sbostic #endif /* not lint */
1311802Slinton 
1438105Sbostic #ifndef lint
15*42683Sbostic static char sccsid[] = "@(#)mkdate.c	5.5 (Berkeley) 06/01/90";
1638105Sbostic #endif /* not lint */
1718225Slinton 
1811802Slinton #include <stdio.h>
1933325Sdonn #ifdef IRIS
2033325Sdonn #   include <time.h>
2133325Sdonn #else
2233325Sdonn #   include <sys/time.h>
2333325Sdonn #endif
2411802Slinton 
main()2511802Slinton main()
2611802Slinton {
2711802Slinton     struct tm *t;
2811802Slinton     long clock;
2911802Slinton     char name[100];
3011802Slinton     int namelen;
3111802Slinton 
3211802Slinton     printf("char *date = \"");
3311802Slinton     clock = time(0);
3411802Slinton     t = localtime(&clock);
3511802Slinton     printf("%d/%d/%d ", t->tm_mon + 1, t->tm_mday, t->tm_year % 100);
3611802Slinton     printf("%d:%02d", t->tm_hour, t->tm_min);
3733325Sdonn #   ifndef IRIS
3833325Sdonn 	gethostname(name, &namelen);
3933325Sdonn 	printf(" (%s)", name);
4033325Sdonn #   endif
4111802Slinton     printf("\";\n");
4232081Sbostic     exit(0);
4311802Slinton }
44