mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Fixed wrong DST calculation in my_timezone
SVN revision: 1751
This commit is contained in:
parent
660e6f5f32
commit
692bfbd2d0
@ -592,13 +592,10 @@ int my_read(int fh, void *buffer, unsigned int bytes)
|
|||||||
/* workaround for wong timezone under MAX OSX */
|
/* workaround for wong timezone under MAX OSX */
|
||||||
long my_timezone()
|
long my_timezone()
|
||||||
{
|
{
|
||||||
#ifdef OS_MACOSX
|
#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||||
time_t tp;
|
time_t tp;
|
||||||
time(&tp);
|
time(&tp);
|
||||||
if (localtime(&tp)->tm_isdst > 0)
|
return -localtime(&tp)->tm_gmtoff;
|
||||||
return -localtime(&tp)->tm_gmtoff + 3600;
|
|
||||||
else
|
|
||||||
return -localtime(&tp)->tm_gmtoff;
|
|
||||||
#else
|
#else
|
||||||
return timezone;
|
return timezone;
|
||||||
#endif
|
#endif
|
||||||
@ -16679,6 +16676,8 @@ void show_rss_feed(LOGBOOK * lbs)
|
|||||||
assert(ts);
|
assert(ts);
|
||||||
strftime(str, sizeof(str), "%a, %d %b %Y %H:%M:%S", ts);
|
strftime(str, sizeof(str), "%a, %d %b %Y %H:%M:%S", ts);
|
||||||
offset = (-(int) my_timezone());
|
offset = (-(int) my_timezone());
|
||||||
|
if (ts->tm_isdst)
|
||||||
|
offset += 3600;
|
||||||
snprintf(date, sizeof(date) - 1, "%s %+03d%02d", str, (int) (offset / 3600),
|
snprintf(date, sizeof(date) - 1, "%s %+03d%02d", str, (int) (offset / 3600),
|
||||||
(int) ((abs((int) offset) / 60) % 60));
|
(int) ((abs((int) offset) / 60) % 60));
|
||||||
getcfg("global", "Language", str, sizeof(str));
|
getcfg("global", "Language", str, sizeof(str));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user