1 /* Copyright (c) 1982 Regents of the University of California */ 2 3 static char sccsid[] = "@(#)mkdate.c 1.2 07/03/83"; 4 5 #include <stdio.h> 6 #include <sys/time.h> 7 8 main() 9 { 10 struct tm *t; 11 long clock; 12 char name[100]; 13 int namelen; 14 15 printf("char *date = \""); 16 clock = time(0); 17 t = localtime(&clock); 18 printf("%d/%d/%d ", t->tm_mon + 1, t->tm_mday, t->tm_year % 100); 19 printf("%d:%02d", t->tm_hour, t->tm_min); 20 gethostname(name, &namelen); 21 printf(" (%s)", name); 22 printf("\";\n"); 23 } 24