00001 #include <grass/gis.h> 00002 /* 00003 ********************************************************************** 00004 * 00005 * char * 00006 * G_date () 00007 * 00008 * returns pointer to a string containing the current date and time 00009 * 00010 **********************************************************************/ 00011 00012 #include <time.h> 00013 00014 00026 char * 00027 G_date() 00028 { 00029 long clock; 00030 struct tm *local; 00031 char *date; 00032 char *d; 00033 00034 char *asctime(); 00035 struct tm *localtime(); 00036 00037 time(&clock); 00038 00039 local = localtime(&clock); 00040 date = asctime(local); 00041 for (d = date; *d; d++) 00042 if (*d == '\n') 00043 *d = 0; 00044 return date; 00045 }