$Log$
+ Revision 1.494 2000/03/19 23:04:08 ajc
+ * Small cosmetic change to date/time output
+
Revision 1.493 2000/03/19 05:02:39 ajc
* SMTP hacks to deal with AOL braindamage
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
+
#include "sysdep.h"
#include "sysconfig.h"
#include "ipcdef.h"
-#define CITADEL "Citadel/UX 5.70b1"
+#define CITADEL "Citadel/UX 5.70b2"
#define REV_LEVEL 570
#define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
obtain SERVER_TYPE codes for your implementations */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
-#include <time.h>
#include <signal.h>
#include <errno.h>
#include <limits.h>
#include <sys/wait.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <stdarg.h>
#include "citadel.h"
#include "messages.h"
char buf[256];
char m_subject[256];
char from[256], node[256], rfca[256];
- time_t now;
- struct tm *tm;
+ char now[256];
int format_type = 0;
int fr = 0;
int nhdr = 0;
printf("%s ",&buf[5]);
}
if (!struncmp(buf,"time=",5)) {
- now=atol(&buf[5]);
- tm=(struct tm *)localtime(&now);
- strcpy(buf,asctime(tm)); buf[strlen(buf)-1]=0;
- strcpy(&buf[16],&buf[19]);
- color(BRIGHT_MAGENTA);
- printf("%s ",&buf[4]);
+ fmt_date(now, atol(&buf[5]));
+ printf("%s ", now);
}
}
{
FILE *fp;
int a,b,e_ex_code;
- time_t now;
long beg;
char datestr[64];
int cksum = 0;
mode=0;
}
- time(&now);
- strcpy(datestr,asctime(localtime(&now)));
- datestr[strlen(datestr)-1] = 0;
+ fmt_date(datestr, time(NULL));
if (room_flags & QR_ANONONLY) {
printf(" ****");
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
+#include <sys/time.h>
#include "tools.h"
#define TRUE 1
free(c2);
return(ret);
}
+
+
+
+/*
+ * Format a date/time stamp for output
+ */
+void fmt_date(char *buf, time_t thetime) {
+ struct tm *tm;
+
+ char *ascmonths[] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+
+ strcpy(buf, "");
+ tm = localtime(&thetime);
+
+ sprintf(buf, "%s %d %d %d:%02d%s",
+ ascmonths[tm->tm_mon],
+ tm->tm_mday,
+ tm->tm_year + 1900,
+ ( (tm->tm_hour > 12) ? (tm->tm_hour - 12) : (tm->tm_hour) ),
+ tm->tm_min,
+ ( (tm->tm_hour > 12) ? "pm" : "am" )
+ );
+}
+
+
+
+
+
+
int haschar(char *st, int ch);
int collapsed_strcmp(char *s1, char *s2);
void remove_token(char *source, int parmnum, char separator);
+void fmt_date(char *buf, time_t thetime);
#define extract(dest,source,parmnum) extract_token(dest,source,parmnum,'|')
#define num_parms(source) num_tokens(source, '|')