SQLite Hours/Minutes/Seconds
#1

Hello,i want a tutorial about how to save Hours/Minutes/Seconds on SQLite.

Thanks!
Reply
#2

search more
https://sampforum.blast.hk/showthread.php?tid=262417
Reply
#3

thx..but i need a tutorial..about HOURS/MINUTES/SECONDS...not this
Reply
#4

Just save it as you would save any other string.
Reply
#5

yes..but need to create timers...and i do not know how to create this..
Reply
#6

pawn Код:
new time = gettime()
Time and date, saved in an integer value. You will need something to decode the unix timestamp, though, as I don't think SQLite supports that functionality.
Reply
#7

There are two ways, first with a timer and get the hours/minutes/seconds by using that function and the second way is by using "gettime". The links are both with an example of each way.
Reply
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
pawn Код:
new time = gettime()
Time and date, saved in an integer value. You will need something to decode the unix timestamp, though, as I don't think SQLite supports that functionality.
You don't have to decode it if you pass vars by reference.

From the wiki:
pawn Код:
new Hour, Minute, Second;
gettime(Hour, Minute, Second);
printf("%02d:%02d:%02d", Hour, Minute, Second);
Reply
#9

You only store the integer value in the table, not the individual variables. So yes, you do need to decode it.
Reply
#10

Not if you store the time/date as a string.

EDIT: I see what you mean vince, for things like time played it should really be stored as integer, but if it's for something like join date it would be better to store as a string, then you don't need to use a function to convert it when the value will never change.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)