 |
Server Help Community forums for Subgame, ASSS, and bots
|
Author |
Message |
tikiman Newbie
Joined: Jan 25 2003 Posts: 14 Offline
|
Posted: Mon Mar 03, 2003 1:35 am Post subject: local time? |
 |
|
|
|
Is there any way to obtain the actual time for logging purposes? |
|
Back to top |
|
 |
Underlord Guest
Offline
|
Posted: Mon Mar 03, 2003 2:13 pm Post subject: example |
 |
|
|
|
heres an example how to do that: (squadA and squadB are examples)
// create log file name
char u[100];
time_t t=time(NULL);
tm *tmp = localtime(&t);
strftime(u,99,"%y",tmp);
logname = "c:\\logs\\";
logname += u;
logname += "y";
strftime(u,99,"%m",tmp);
logname += u;
logname += "m";
strftime(u,99,"%d",tmp);
logname += u;
logname += "d";
logname += squadA;
logname += " vs ";
logname += squadB;
strftime(u,99,"%I",tmp);
logname += u;
logname += "h";
strftime(u,99,"%M",tmp);
logname += u;
logname += "m";
logname += ".txt";
// create log file
ofstream outf(logname); |
|
Back to top |
|
 |
Underlord Guest
Offline
|
Posted: Mon Mar 03, 2003 2:14 pm Post subject: and |
 |
|
|
|
if squadA/squadB are Sandstorm/Fearless, the code would create
03y03m01dSandstorm vs Fearless08h01m.txt |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
Software by php BB © php BB Group Server Load: 33 page(s) served in previous 5 minutes.
|