10.10.2014, 16:51
Hi guys,
I want make one function which create code(for account activation etc...) with time and date.... Code must have 14 numbers(eg. 05100820140611, 05 - hour; 10 - minute; 08 - second; 2014 - year; 06 - month; 11 - day). I made this, but I got negativ code(code in minus).
I want make one function which create code(for account activation etc...) with time and date.... Code must have 14 numbers(eg. 05100820140611, 05 - hour; 10 - minute; 08 - second; 2014 - year; 06 - month; 11 - day). I made this, but I got negativ code(code in minus).
Код:
stock _SoD_GenerateCode() { new _dan, _mjesec, _godina; new _sat, _minuta, _sekunda; new _code[15]; getdate(_godina, _mjesec, _dan); gettime(_sat, _minuta, _sekunda); format(_code, 15, "%02d%02d%02d%d%02d%02d", _sat, _minuta, _sekunda, _godina, _mjesec, _dan); return _code; }