+ /*
+ * DATEFMT_FULL: full display
+ * DATEFMT_BRIEF: if date == today, show only the time
+ * otherwise, for messages up to 6 months old,
+ * show the month and day, and the time
+ * older than 6 months, show only the date
+ * DATEFMT_RAWDATE: show full date, regardless of age
+ * DATEFMT_LOCALEDATE: show full date as prefered for the locale
+ */
+
+ switch (Format) {
+ case DATEFMT_BRIEF:
+ if ((tm.tm_year == today_tm.tm_year)
+ &&(tm.tm_mon == today_tm.tm_mon)
+ &&(tm.tm_mday == today_tm.tm_mday)) {
+ if (time_format == WC_TIMEFORMAT_24)
+ retlen = wc_strftime(buf, siz, "%k:%M", &tm);
+ else
+ retlen = wc_strftime(buf, siz, "%l:%M%p", &tm);
+ }
+ else if (today_timet - thetime < 15552000) {
+ if (time_format == WC_TIMEFORMAT_24)
+ retlen = wc_strftime(buf, siz, "%b %d %k:%M", &tm);
+ else
+ retlen = wc_strftime(buf, siz, "%b %d %l:%M%p", &tm);
+ }
+ else {
+ retlen = wc_strftime(buf, siz, "%b %d %Y", &tm);
+ }
+ break;
+ case DATEFMT_FULL:
+ if (time_format == WC_TIMEFORMAT_24)
+ retlen = wc_strftime(buf, siz, "%a %b %d %Y %T %Z", &tm);
+ else
+ retlen = wc_strftime(buf, siz, "%a %b %d %Y %r %Z", &tm);
+ break;
+ case DATEFMT_RAWDATE:
+ retlen = wc_strftime(buf, siz, "%a %b %d %Y", &tm);
+ break;
+ case DATEFMT_LOCALEDATE:
+ retlen = wc_strftime(buf, siz, "%x", &tm);
+ break;
+ }
+ return retlen;
+}