Server Help

ASSS Questions - local time

EdTheInvincible - Sat Feb 19, 2005 4:24 pm
Post subject: local time
having ?uptime give you the server's local date and time as well would be good, so you could have timestamps inside log files. and i bet it's not that hard to implement either. ok maybe it is, i dont know, i dont do any asss coding. but it would be really useful, so you might just want to do it. biggrin.gif
MS-DOS - Mon Feb 21, 2005 9:56 am
Post subject:
Well, if you are a sysop you can see the local time when you type in *log.
Dr Brain - Mon Feb 21, 2005 10:05 am
Post subject:
Make a ?localtime command and send me the source. I'll put it up in Hyperspace.
Mine GO BOOM - Mon Feb 21, 2005 12:08 pm
Post subject:
Code: Show/Hide
time_t t1;
char t3[128];

time(&t1);
strftime(t3, sizeof(t3), CFG_TIMEFORMAT, localtime(&t1));

Stolen right from log_file.c's LogFile function. Works on both Linux and Windows without a problem. Learn more about the format specification to setup whatever output you want. If you want, make it where even the user can input his own format string. Just make sure you null-terminate it at a safe length, and should't have a problem with it, as I don't see a specification saying that strftime is required to null-terminate it.
Solo Ace - Mon Feb 21, 2005 1:26 pm
Post subject:
Yay, what a great idea. sa_tongue.gif
EdTheInvincible - Mon Feb 21, 2005 1:27 pm
Post subject:
i hope it works.. i dont do alot of asss coding new_evil.gif
Night_Fox - Tue Feb 22, 2005 5:03 am
Post subject:
Cool but I have a better idea icon_wink.gif
Solo Ace - Tue Feb 22, 2005 1:50 pm
Post subject:
Yeah, setting up a MySQL database server and then h4x the client to force it to open up a browser window loading a page which queries the MySQL database for the current time and then makes it show on the webpage is a great idea!
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group