1 // Date formatter for German dates (in German)
2 // a-umlaut in Maerz is written as "ae" for compatibility reasons
3 // use date format deL1 or deHTML for correct umlaut
4 // 8/1998 jk
5 #include "config.h"
6 
7 #ifdef TM_IN_SYS_TIME
8 #include <sys/time.h>
9 #else
10 #include <time.h>
11 #endif
12 
13 #ifdef HAVE_STRING_H
14 #include <string.h>
15 #else /* do not have sting.h */
16 #include <strings.h>
17 #endif /* HAVE_STRING_H */
18 #define __EXCLUDE_READER_CLASSES
19 #include "lib.h"
20 
de_date(time_t when)21 char *de_date(time_t when)
22 {
23     static const char *months[]=
24     {
25 	"Januar", "Februar", "Maerz", "April",
26 	"Mai", "Juni", "Juli", "August",
27 	"September", "Oktober", "November", "Dezember",
28     };
29 
30     struct tm *tim;
31     char date_buf[200];
32 
33     tim=localtime(&when);
34 
35     sprintf(date_buf, "%d. %s %d", tim->tm_mday,
36 	    months[tim->tm_mon], 1900+tim->tm_year);
37 
38     return strdup(date_buf);
39 }
40