time.c
skylib_mudos_v1/mudlib/cmds/player/time.c · 1.0 KB
From the archive skylib_mudos_v1.tar.gz
Download the archive « Back to the archive contents
#include <localtime.h>
#include <dst.h>
#define SPECIAL_DAY "/handlers/special_day"
inherit COMMAND_BASE;
mixed *_timezones;
void create() {
mixed *time_rubbish;
time_rubbish = localtime(time());
_timezones = ({ });
/* "Seattle", - time_rubbish[LT_GMTOFF],
"Toronto", - time_rubbish[LT_GMTOFF] + 3 * (60 * 60),
"London", 0,
"Perth", 8 * (60 * 60),
"Sydney", (10 + AUS_DST) * (60 * 60),
});
*/
} /* create() */
mixed cmd( string word ) {
mixed *time_rubbish;
int i;
string mess;
write("On "+mud_name()+", it is "+mudtime(time())+".\n"
"Server time - "+ctime(time())+".\n");
return 1;
time_rubbish = localtime(time());
/* Figure out the gmt time. */
for (i = 0; i < sizeof(_timezones); i += 2) {
mess += sprintf( "[%s in %-9s]\n", ctime(time() + time_rubbish[LT_GMTOFF] +
_timezones[i + 1]), _timezones[i]);
}
write(mess);
return 1;
} /* cmd() */
mixed *query_patterns() {
return ({ "", (: cmd :) });
} /* query_patterns() */