mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed problem with daylight savings time
SVN revision: 59
This commit is contained in:
parent
04506605cb
commit
30cfee7f81
10
elogd.c
10
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.22 2002/05/13 20:50:53 midas
|
||||||
|
Fixed problem with daylight savings time
|
||||||
|
|
||||||
Revision 1.21 2002/05/03 07:39:16 midas
|
Revision 1.21 2002/05/03 07:39:16 midas
|
||||||
Fixed bug with "Content-Length"
|
Fixed bug with "Content-Length"
|
||||||
|
|
||||||
@ -462,7 +465,7 @@ INT sendmail(char *smtp_host, char *from, char *to, char *subject, char *text)
|
|||||||
{
|
{
|
||||||
struct sockaddr_in bind_addr;
|
struct sockaddr_in bind_addr;
|
||||||
struct hostent *phe;
|
struct hostent *phe;
|
||||||
int s;
|
int s, offset;
|
||||||
char buf[80];
|
char buf[80];
|
||||||
char str[10000];
|
char str[10000];
|
||||||
time_t now;
|
time_t now;
|
||||||
@ -526,8 +529,11 @@ struct tm *ts;
|
|||||||
time(&now);
|
time(&now);
|
||||||
ts = localtime(&now);
|
ts = localtime(&now);
|
||||||
strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", ts);
|
strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S", ts);
|
||||||
|
offset = (-(int)timezone);
|
||||||
|
if (daylight)
|
||||||
|
offset += 3600;
|
||||||
snprintf(str, sizeof(str) - 1, "Date: %s %+03d%02d\r\n\r\n", buf,
|
snprintf(str, sizeof(str) - 1, "Date: %s %+03d%02d\r\n\r\n", buf,
|
||||||
(int) (-(int)timezone/3600), (int) ((abs((int)timezone)/60) % 60));
|
(int) (offset/3600), (int) ((abs((int)offset)/60) % 60));
|
||||||
send(s, str, strlen(str), 0);
|
send(s, str, strlen(str), 0);
|
||||||
if (verbose) puts(str);
|
if (verbose) puts(str);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user