* \defgroup HTTPDateTime Function to generate HTTP-compliant textual time/date stamp
* (This module was lifted directly from the Citadel server source)
*
+ * \ingroup WebcitHttpServer
*/
/*@{*/
#include "webcit.h"
}
+void tmplput_nowstr(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
+{
+ time_t now;
+ now = time(NULL);
+ StrEscAppend(Target, NULL, asctime(localtime(&now)), 0, 0);
+}
+void tmplput_nowno(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
+{
+ time_t now;
+ now = time(NULL);
+ StrBufAppendPrintf(Target, "%l", now);
+}
+
+void
+InitModule_DATE
+(void)
+{
+ RegisterNamespace("DATE:NOW:STR", 1, 2, tmplput_nowstr, CTX_NONE);
+ RegisterNamespace("DATE:NOW:NO", 1, 2, tmplput_nowno, CTX_NONE);
+}
+
/*@}*/