From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- support/word2x/deL1date.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 support/word2x/deL1date.cc (limited to 'support/word2x/deL1date.cc') diff --git a/support/word2x/deL1date.cc b/support/word2x/deL1date.cc new file mode 100644 index 0000000000..43e0051f7f --- /dev/null +++ b/support/word2x/deL1date.cc @@ -0,0 +1,38 @@ +// Date formatter for German dates (in German) +// With correct a-umlaut in ISO-8859-1 (Latin-1) charset +// 8/1998 jk +#include "config.h" + +#ifdef TM_IN_SYS_TIME +#include +#else +#include +#endif + +#ifdef HAVE_STRING_H +#include +#else /* do not have sting.h */ +#include +#endif /* HAVE_STRING_H */ +#define __EXCLUDE_READER_CLASSES +#include "lib.h" + +char *deL1_date(time_t when) +{ + static const char *months[]= + { + "Januar", "Februar", "März", "April", + "Mai", "Juni", "Juli", "August", + "September", "Oktober", "November", "Dezember", + }; + + struct tm *tim; + char date_buf[200]; + + tim=localtime(&when); + + sprintf(date_buf, "%d. %s %d", tim->tm_mday, + months[tim->tm_mon], 1900+tim->tm_year); + + return strdup(date_buf); +} -- cgit v1.2.3