SA-MP Forums Archive
How do you use timestamps to get current time in words? - 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: How do you use timestamps to get current time in words? (/showthread.php?tid=523150)



How do you use timestamps to get current time in words? - sammp - 30.06.2014

Hey, I seem to be regular here now. (lol)

Anyways, I'm making a system where people can check when they last logged in.


Thing is, I don't know how to use timestamps and how to convert it into words.

Help would be appreciated with a rep!


Re: How do you use timestamps to get current time in words? - Vince - 30.06.2014

Yet, what these topics never mention is the saving system that's in use. In MySQL it is extremely easy to use the inbuilt from_unixtime() function.


Re: How do you use timestamps to get current time in words? - Juvanii - 30.06.2014

- https://sampforum.blast.hk/showthread.php?tid=347605

Also check this ban system if you want to learn more about it: https://sampforum.blast.hk/showthread.php?tid=503631


Re: How do you use timestamps to get current time in words? - sammp - 30.06.2014

What is 'from_unixtime()'?

Can you explain it to me and give me an example, please? (never heard of that func)


Re: How do you use timestamps to get current time in words? - sammp - 30.06.2014

Quote:
Originally Posted by Juvanii
Посмотреть сообщение
Yeah, but how can I use it to display the current time.


(Im confused right now as I am pretty tired)


Re: How do you use timestamps to get current time in words? - Juvanii - 30.06.2014

Quote:
Originally Posted by sammp
Посмотреть сообщение
Yeah, but how can I use it to display the current time.
I'm pretty sure that u haven't even check the ban system -_-


Re: How do you use timestamps to get current time in words? - sammp - 30.06.2014

JUst read it and i think i understand now. Thanks!


Re: How do you use timestamps to get current time in words? - sammp - 30.06.2014

Problem.

I got the functions and stuff working, though this is what it updated to:

Код:
-1-1-1970 at 0:1:0
How do I fix this?