36 lines
729 B
C
36 lines
729 B
C
#include "time_header.h"
|
|
|
|
void settzname(void)
|
|
{
|
|
int i;
|
|
struct state* const sp = lclptr;
|
|
|
|
tzname[0] = tzname[1] = (char *) wildabbr;
|
|
|
|
daylight = 0;
|
|
timezone = 0;
|
|
altzone = 0;
|
|
zonechg = 1;
|
|
|
|
if (sp == NULL) {
|
|
tzname[0] = tzname[1] = (char *) gmt;
|
|
return;
|
|
}
|
|
|
|
/*
|
|
** And to get the latest zone names into tzname. . .
|
|
*/
|
|
for (i = 0; i < sp->typecnt; ++i) {
|
|
const struct ttinfo * const ttisp = &sp->ttis[i];
|
|
update_tzname(sp, ttisp);
|
|
}
|
|
|
|
for (i = 0; i < sp->timecnt; ++i) {
|
|
const struct ttinfo * const ttisp = &sp->ttis[sp->types[i]];
|
|
update_tzname(sp, ttisp);
|
|
|
|
if (ttisp->tt_isdst)
|
|
daylight = 1;
|
|
}
|
|
}
|