added a time stamp argument to FormatTime

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401047
This commit is contained in:
Borja Ferrer 2007-07-05 14:47:36 +00:00
parent 3d7ef5ce49
commit 8bf7cb08f2
2 changed files with 3 additions and 2 deletions

View File

@ -89,7 +89,7 @@ static cell_t FormatTime(IPluginContext *pContext, const cell_t *params)
pContext->LocalToString(params[1], &buffer); pContext->LocalToString(params[1], &buffer);
pContext->LocalToString(params[3], &format); pContext->LocalToString(params[3], &format);
time_t t = time(NULL); time_t t = (params[4] == -1) ? time(NULL) : (time_t)params[4];
strftime(buffer, params[2], format, localtime(&t)); strftime(buffer, params[2], format, localtime(&t));
return 1; return 1;

View File

@ -270,9 +270,10 @@ native GetTime(bigStamp[2]={0,0});
* @param buffer Destination string buffer. * @param buffer Destination string buffer.
* @param maxlength Maximum length of output string buffer. * @param maxlength Maximum length of output string buffer.
* @param format Formatting rules. * @param format Formatting rules.
* @param stamp Optional time stamp.
* @noreturn * @noreturn
*/ */
native FormatTime(String:buffer[], maxlength, const String:format[]); native FormatTime(String:buffer[], maxlength, const String:format[], stamp=-1);
/** /**
* Loads a game config file. * Loads a game config file.