04 Nov, 2007, basil wrote in the 1st comment:
Votes: 0
Hi
is it possible to alter system time in CircleMud? Currently, the time it reports in logs is vastly different to my real time (different GMT zone I guess).

I'd like to be able to check logs and relate to them, without adding or subtracting time.

Is there a configuration for time anywhere?

cheers

Basil
05 Nov, 2007, Tyche wrote in the 2nd comment:
Votes: 0
#include <time.h>
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
time_t td;

putenv("TZ=PST8PDT");
tzset();
time(&td);
printf("Current time = %s\n", asctime(localtime(&td)));
return 0;
}


see man tzset
05 Nov, 2007, basil wrote in the 3rd comment:
Votes: 0
Thanks Tyche

I'm a noob - where does that code get inserted?

Cheers

Basil
05 Nov, 2007, David Haley wrote in the 4th comment:
Votes: 0
You'd put the putenv and tzset commands at the beginning of your 'main' function in the c source. Of course, you would have to adjust the timezone to whatever is more appropriate for you.
08 Nov, 2007, basil wrote in the 5th comment:
Votes: 0
I assume the same works for Mordor.

Which file would one use - it seems to be a large collection of files?

Basil
08 Nov, 2007, David Haley wrote in the 6th comment:
Votes: 0
Using Tyche's suggestion from the other thread, you should try grepping for 'main' – that will show you where the main function is. ('main' is the entry point to the program.)
0.0/6