/* * This code is easy enough to use. It returns time (based on system time) in a * HH:MM format. Simply add this to your code, wherever you see fit. * * While it was WRITTEN on a ROM base mud, There shouldn't be any reason that it * would not work with any codebase. * * The only real downside to this code is that since it uses system time, it could * be incorrect if the system time is wrong, or if, perhaps, the system is hosted in * like ... Finland or something. :) * * If you use this code ... then use it :P I don't require an email. I don't request * a line in a helpfile, nor do I even need recognition of making it. :) * I could care less if you tell me or not - The only thing I DO request is don't pawn * off other people's code as your own. That's lame, reguardless of who wrote it. :) * * It was, however, originally written by Raum, Ivalice Mud (ivalicemud.com 6712) * Enjoy. */ char *timestamp( char strtime[16] ) { int count; char buf[MAX_STRING_LENGTH], tim[16]; sprintf( buf, ctime( ¤t_time ) ); for( count = 0; count < 16; count++ ) tim[count] = buf[count+11]; tim[5] = '\0'; sprintf( strtime, tim ); return str_dup(strtime); } /* * Add the prototype in merc.h (or mud.h, or whatever system you use.h :P) */ char *timestamp args( ( char strtime[16] ) ); /* * Boom. Throw it in some code. Places I use this are: * AFK Messages: * sprintf(buf,"[%s]{x %s tells you '%s'\n\r",timestamp(buf), PERS(ch,victim),argument); * This returns the message, when I type replay, of: * [20:09] Raum tells you 'asd' * * I also use it in my Gossip Log to show when messages were sent. * It's easy enough to add, and there's probably an easier or better way to do this, * but this works for me, and that's all that counts :) * - Raum */