From 49a5dd09b9aaba81fa217c9d41fce5e1f90c054b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Mar 1998 04:56:58 +0000 Subject: added Date and Expires headers in the mini web server so clients know what they can cache. (This used to be commit b6055e40bb91775a29b756640d95910a6f19814f) --- source3/lib/time.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/lib/time.c') diff --git a/source3/lib/time.c b/source3/lib/time.c index f60af60c7a..c5584fd143 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -451,6 +451,21 @@ time_t make_unix_date3(void *date_ptr) return(t); } + +/*************************************************************************** +return a HTTP/1.0 time string + ***************************************************************************/ +char *http_timestring(time_t t) +{ + static char buf[40]; + struct tm *tm = LocalTime(&t); + + strftime(buf, sizeof(buf)-1, "%a, %d %b %Y %H:%M:%S %Z", tm); + return buf; +} + + + /**************************************************************************** return the date and time as a string ****************************************************************************/ -- cgit