xref: /csrg-svn/old/dbx/mkdate.c (revision 38105)
121612Sdist /*
2*38105Sbostic  * Copyright (c) 1983 The Regents of the University of California.
3*38105Sbostic  * All rights reserved.
4*38105Sbostic  *
5*38105Sbostic  * Redistribution and use in source and binary forms are permitted
6*38105Sbostic  * provided that the above copyright notice and this paragraph are
7*38105Sbostic  * duplicated in all such forms and that any documentation,
8*38105Sbostic  * advertising materials, and other materials related to such
9*38105Sbostic  * distribution and use acknowledge that the software was developed
10*38105Sbostic  * by the University of California, Berkeley.  The name of the
11*38105Sbostic  * University may not be used to endorse or promote products derived
12*38105Sbostic  * from this software without specific prior written permission.
13*38105Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14*38105Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15*38105Sbostic  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1621612Sdist  */
1711802Slinton 
1821612Sdist #ifndef lint
19*38105Sbostic char copyright[] =
20*38105Sbostic "@(#) Copyright (c) 1983 The Regents of the University of California.\n\
21*38105Sbostic  All rights reserved.\n";
22*38105Sbostic #endif /* not lint */
2311802Slinton 
24*38105Sbostic #ifndef lint
25*38105Sbostic static char sccsid[] = "@(#)mkdate.c	5.4 (Berkeley) 05/23/89";
26*38105Sbostic #endif /* not lint */
2718225Slinton 
2811802Slinton #include <stdio.h>
2933325Sdonn #ifdef IRIS
3033325Sdonn #   include <time.h>
3133325Sdonn #else
3233325Sdonn #   include <sys/time.h>
3333325Sdonn #endif
3411802Slinton 
3511802Slinton main()
3611802Slinton {
3711802Slinton     struct tm *t;
3811802Slinton     long clock;
3911802Slinton     char name[100];
4011802Slinton     int namelen;
4111802Slinton 
4211802Slinton     printf("char *date = \"");
4311802Slinton     clock = time(0);
4411802Slinton     t = localtime(&clock);
4511802Slinton     printf("%d/%d/%d ", t->tm_mon + 1, t->tm_mday, t->tm_year % 100);
4611802Slinton     printf("%d:%02d", t->tm_hour, t->tm_min);
4733325Sdonn #   ifndef IRIS
4833325Sdonn 	gethostname(name, &namelen);
4933325Sdonn 	printf(" (%s)", name);
5033325Sdonn #   endif
5111802Slinton     printf("\";\n");
5232081Sbostic     exit(0);
5311802Slinton }
54