On Fri, Aug 02, 2002 at 11:06:37AM -0400, Vertigo wrote:
> I added the following line into do_time:
>       setenv( "TZ", "EST5EDT", 1);
> 
> That got it set to EST with regard to EDT.  I *am* interested in exactly
> what Edwin did with his multiple time zone output.  
> 
> Care to share, Edwin?

#define MAX_TIMEZONES               4

struct mud_data {
    int         time_offsets    [MAX_TIMEZONES];
    char *      time_zones      [MAX_TIMEZONES];
};


void do_time(CHAR_DATA *ch,char *arg) {
[...]
    now=time(NULL);
    for (i=0;i<4;i++)
        if (mud_data.time_zones[i][0]) {
            there=now+mud_data.time_offsets[i]*3600;
            sprintf_to_char(ch,"The time in %-15s is %-3s\r",
                mud_data.time_zones[i],ctime(&there));
        }
}

And the config-file for the time:

#TIME
0 Europe~
8 Australia~
-6 EasternUSA~
-9 WesternUSA~
0 0~

Yes, twice a year during the change in DST the time in Australia
needs to be corrected. But then, if the server was on the southern
hemisphere the other three would have to be corrected :-)

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.MavEtJu.org
[EMAIL PROTECTED]    |    Weblog: http://www.mavetju.org/weblog/weblog.php 
bash$ :(){ :|:&};:   | Interested in MUDs? http://www.FatalDimensions.org/

Reply via email to