$Log$
+Revision 619.11 2005/06/24 15:17:48 ajc
+* The date/time stamp of messages are now output using JavaScript's
+ toLocaleString() function, observing the browser's locale and timezone
+ instead of the web server's.
+
Revision 619.10 2005/06/23 04:01:59 ajc
* groupdav_main.c: remove double slashes in path name
(suggested by Johannes Schneider)
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
char node[SIZ];
char rfca[SIZ];
char reply_to[512];
- char now[SIZ];
int format_type = 0;
int nhdr = 0;
int bq = 0;
if (!strncasecmp(buf, "rcpt=", 5))
wprintf("to %s ", &buf[5]);
if (!strncasecmp(buf, "time=", 5)) {
- fmt_date(now, atol(&buf[5]), 0);
- wprintf("%s ", now);
+ wprintf("<script type=\"text/javascript\">"
+ "output_datetime(%s);"
+ "</script> ", &buf[5]);
}
if (!strncasecmp(buf, "part=", 5)) {
}
now = time(NULL);
- fmt_date(buf, now, 0);
+ strcpy(buf, "");
strcat(&buf[strlen(buf)], " <I>from</I> ");
stresc(&buf[strlen(buf)], WC->wc_username, 1, 1);
if (strlen(bstr("recp")) > 0) {
wprintf("<input type=\"hidden\" name=\"postseq\" value=\"%ld\">\n",
now);
- wprintf("%s<br>\n", buf); /* header bar */
+ /* header bar */
+ wprintf("<script type=\"text/javascript\">"
+ "output_datetime(%ld);"
+ "</script> ", now);
+ wprintf("%s<br>\n", buf);
wprintf("<img src=\"static/enter.gif\" align=middle alt=\" \">");
/* "onLoad=\"document.enterform.msgtext.focus();\" " */
wprintf("<font size=-1>Subject (optional):</font>"
document.poppedLayer = eval('document.layers[\'`page_popup\']');
document.poppedLayer.style.visibility = "hidden";
}
+
+
+// Given a unix timestamp, outputs a date/time using the browser's
+// timezone and locale.
+function output_datetime(unixtimestamp) {
+ var now = new Date();
+ now.setTime(unixtimestamp * 1000);
+ document.write(now.toLocaleString());
+}