#1

Is there a way to save seconds in a time format for example :
PHP Code:
day:hours:seconds 
in mysql ?
Reply
#2

Yeah, use "gettime", EG:

PHP Code:
new str[20], time[3];
gettime(time[0], time[1], time[2]);
format(strsizeof(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).
Reply
#3

Quote:
Originally Posted by iGetty
View Post
Yeah, use "gettime", EG:

PHP Code:
new str[20], time[3];
gettime(time[0], time[1], time[2]);
format(strsizeof(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.
Reply
#4

https://dev.mysql.com/doc/refman/5.5...on_sec-to-time
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)