cathy@cs.reading.UUCP (Cathy Garlick) (04/12/85)
We have just installed news 2.10.2 and noticed the following problems
ith timezones.
First there's the fairly well-known one about British Summer Time and
Bering Straits time.
All the European timezones were missing from getdate.y.
So i made the following changes to getdate.y
--------------------------------------------------------------------------------
line 313 in '<', getdate.y.old
changed from line 313 in '>', getdate.y:
< {"bst", ZONE, 11 HRS},
---
> {"bst", ZONE, -1 HRS}, /* British Summer Time */
lines 320 to 335 in '>', getdate.y
appended after line 319 in getdate.y.old:
>
> /* European timezones included */
>
> {"eet", ZONE, 0 HRS}, /* European Eastern Time */
> {"e.e.t.", ZONE, 0 HRS},
> {"eest", ZONE, 0 HRS}, /* European Eastern Summer Time */
> {"e.e.s.t.", ZONE, 0 HRS},
> {"met", ZONE, -1 HRS}, /* Middle European Time */
> {"m.e.t.", ZONE, -1 HRS},
> {"mest", DAYZONE, -1 HRS}, /* Middle European Summer Time */
> {"m.e.s.t.", DAYZONE, -1 HRS},
> {"wet", ZONE, -2 HRS }, /* Western European Time */
> {"w.e.t.", ZONE, -2 HRS },
> {"west", DAYZONE, -2 HRS}, /* Western European Summer Time */
> {"w.e.s.t.", DAYZONE, -2 HRS},
>
--------------------------------------------------------------------------------
Another problem i found was that the date was always being written as GMT
although we're now in BST, at no point could i find localtime being set
anywhere so i made the following changes to function arpadate in funcs2.c
--------------------------------------------------------------------------------
lines 196 to 198 in '>', funcs2.c
appended after line 195 in funcs2.c.old:
> /* This is the version of arpadate from news.2.10 which uses
> * localtime
> */
line 204 in '>', funcs2.c
appended after line 200 in funcs2.c.old:
> char *cp;
lines 203 to 204 in '<', funcs2.c.old
changed from lines 207 to 211 in '>', funcs2.c:
< extern struct tm *gmtime();
< extern char *asctime();
---
> struct timeb t;
> extern struct tm *localtime();
> extern char *ctime();
> extern struct timeb *ftime();
> extern char *timezone();
lines 206 to 209 in '<', funcs2.c.old
changed from lines 213 to 217 in '>', funcs2.c:
< /* Get current time. This will be used resolve the timezone. */
< ud = asctime(gmtime(longtime));
<
< /* Crack the UNIX date line in a singularly unoriginal way. */
---
> /* Get current time. This will be used to resolve the timezone. */
> ud = ctime(longtime);
> ftime(&t);
>
> /* Crack the UNIX date line in a singularly unoriginal way. */
lines 213 to 215 in '<', funcs2.c.old
changed from lines 221 to 223 in '>', funcs2.c:
< /* until every site installs the fix to getdate.y, the day
< of the week can cause time warps */
< p = &ud[0]; /* Mon */
---
> /* until every site installs the fix to getdate.y, the day of the week
> can cause time warps */
> p = &ud[0]; /* Mon */
line 222 in '<', funcs2.c.old
changed from line 230 in '>', funcs2.c:
< p = &ud[8]; /* 16 */
---
> p = &ud[8]; /* 16 */
line 227 in '<', funcs2.c.old
changed from line 235 in '>', funcs2.c:
< *q++ = *p++; *q++ = ' ';
---
> *q++ = *p++; *q++ = '-';
lines 229 to 230 in '<', funcs2.c.old
changed from lines 237 to 238 in '>', funcs2.c:
< p = &ud[4]; /* Sep */
< *q++ = *p++; *q++ = *p++; *q++ = *p++; *q++ = ' ';
---
> p = &ud[4]; /* Sep */
> *q++ = *p++; *q++ = *p++; *q++ = *p++; *q++ = '-';
line 232 in '<', funcs2.c.old
changed from line 240 in '>', funcs2.c:
< p = &ud[22]; /* 1979 */
---
> p = &ud[22]; /* 1979 */
line 235 in '<', funcs2.c.old
changed from line 243 in '>', funcs2.c:
< p = &ud[11]; /* 01:03:52 */
---
> p = &ud[11]; /* 01:03:52 */
lines 239 to 242 in '<', funcs2.c.old
changed from lines 247 to 259 in '>', funcs2.c:
< *q++ = ' ';
< *q++ = 'G'; /* GMT */
< *q++ = 'M';
< *q++ = 'T';
---
> p = timezone(t.timezone, localtime(&t.time)->tm_isdst);
> if (p[3] != '\0') {
> p+=3;
> *q++ = *p++;
> if (p[1] == ':')
> *q++ = '\0';
> else
> *q++ = *p++;
> *q++ = *p++; p++; *q++ = *p++; *q++ = *p++;
> } else {
> *q++ = ' '; *q++ = *p++;
> *q++ = *p++; *q++ = *p++;
> }
lines 244 to 246 in '<', funcs2.c.old
changed from lines 261 to 262 in '>', funcs2.c:
<
< return (b);
< }
---
> return(b);
> }
--------------------------------------------------------------------------------
Cathy Garlick ...ukc!reading!cathy
Comp. Sci Dept.
Univ. of Reading. UK