Common stuff for all my devices' web server pages: css, login, log, ipv4, ipv6, firmware update, clock, reset info etc.

Dependents:   oldheating gps motorhome heating

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers httpdate.c Source File

httpdate.c

00001 #include <stdlib.h>
00002 
00003 #include   "tm.h"
00004 #include "http.h"
00005 #include  "clk.h"
00006 
00007 static void dateFromTm(struct tm* ptm, char* ptext)
00008 {
00009     size_t size = strftime(ptext, HTTP_DATE_LENGTH, "%a, %d %b %Y %H:%M:%S GMT", ptm);//Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123
00010 }
00011 void HttpDateFromNow(char* pText)
00012 {
00013     struct tm tm;
00014     ClkNowTmUtc(&tm);
00015     dateFromTm(&tm, pText);
00016 }
00017 void HttpDateFromDateTime(const char* date, const char *ptime, char* ptext)
00018 {
00019     struct tm tm;
00020     TmFromAsciiDateTime(date, ptime, &tm);
00021     dateFromTm(&tm, ptext);
00022 }