mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Changed date format to RFC-822 in RSS feed
SVN revision: 1158
This commit is contained in:
parent
5e9b24f1eb
commit
c1209eb2fd
19
src/elogd.c
19
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.528 2005/01/04 10:31:10 midas
|
||||||
|
Changed date format to RFC-822 in RSS feed
|
||||||
|
|
||||||
Revision 1.527 2004/12/29 13:42:38 midas
|
Revision 1.527 2004/12/29 13:42:38 midas
|
||||||
Patch from Recai
|
Patch from Recai
|
||||||
|
|
||||||
@ -14384,9 +14387,11 @@ time_t retrieve_date(char *index, BOOL bstart)
|
|||||||
|
|
||||||
void show_rss_feed(LOGBOOK * lbs)
|
void show_rss_feed(LOGBOOK * lbs)
|
||||||
{
|
{
|
||||||
int i, n, size, index, status, message_id;
|
int i, n, size, index, status, message_id, offset;
|
||||||
char str[256], charset[256], url[256], attrib[MAX_N_ATTR][NAME_LENGTH], date[80], *text, title[2000],
|
char str[256], charset[256], url[256], attrib[MAX_N_ATTR][NAME_LENGTH], date[80], *text, title[2000],
|
||||||
slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH];
|
slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH];
|
||||||
|
time_t ltime;
|
||||||
|
struct tm *ts;
|
||||||
|
|
||||||
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
rsprintf("HTTP/1.1 200 Document follows\r\n");
|
||||||
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
rsprintf("Server: ELOG HTTP %s\r\n", VERSION);
|
||||||
@ -14480,6 +14485,18 @@ void show_rss_feed(LOGBOOK * lbs)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* convert date to RFC-822 date */
|
||||||
|
setlocale(LC_ALL, "C");
|
||||||
|
ltime = date_to_ltime(date);
|
||||||
|
ts = localtime(<ime);
|
||||||
|
strftime(str, sizeof(str), "%a, %d %b %Y %H:%M:%S", ts);
|
||||||
|
offset = (-(int) timezone);
|
||||||
|
snprintf(date, sizeof(date) - 1, "%s %+03d%02d", str, (int) (offset / 3600),
|
||||||
|
(int) ((abs((int) offset) / 60) % 60));
|
||||||
|
getcfg("global", "Language", str, sizeof(str));
|
||||||
|
if (str[0])
|
||||||
|
setlocale(LC_ALL, str);
|
||||||
|
|
||||||
rsprintf("<title>");
|
rsprintf("<title>");
|
||||||
xmlencode(title);
|
xmlencode(title);
|
||||||
rsprintf("</title>\n");
|
rsprintf("</title>\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user