time - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: time (
/showthread.php?tid=633221)
time -
StrikerZ - 27.04.2017
Is there a way to save seconds in a time format for example :
PHP Code:
day:hours:seconds
in mysql ?
Re: time -
iGetty - 27.04.2017
Yeah, use "gettime", EG:
PHP Code:
new str[20], time[3];
gettime(time[0], time[1], time[2]);
format(str, sizeof(str), "%i:%i:%i", time[0], time[1], time[2]);
Then insert it into the DB as a string (Make sure the table settings for that column is a VARCHAR).
Re: time -
StrikerZ - 27.04.2017
Quote:
Originally Posted by iGetty
Yeah, use "gettime", EG:
PHP Code:
new str[20], time[3];
gettime(time[0], time[1], time[2]);
format(str, sizeof(str), "%i:%i:%i", time[0], time[1], time[2]);
Then insert it into the DB as a string (Make sure the table settings for that column is a VARCHAR).
|
Well I had a variable with seconds stored in it. Wanted to convert it to that format.
Re: time -
Vince - 27.04.2017
https://dev.mysql.com/doc/refman/5.5...on_sec-to-time