SA-MP Forums Archive
Time on linux - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Time on linux (/showthread.php?tid=81919)



Time on linux - potato - 15.06.2009

Hi!
Is there a way to get a correct timestamp on linux?
I used this to get one weak back timestamp, but it was still incorrect:
Код:
new hour,minute,second;
new year, month,day;
new thetime, needtime;
gettime(hour, minute, second);
getdate(year, month, day);
thetime = mktime(hour,minute,second,day,month,year);
needtime = thetime-540600;
It showed me a timestamp of 15 (7+ days back.
When I use this to get the timestamp without any other functions then I get also 8 days back.
I'm not sure if I should simply add +8 days timestamp, dunno how it will effect after a while.


Re: Time on linux - pen_theGun - 15.06.2009

check this out:
http://forum.sa-mp.com/index.php?top...9423#msg589423


Re: Time on linux - potato - 15.06.2009

It works!
I searched the forum before but nothing came up :/
But no wonder, keyword "timestamp" returns many results and "linux" wasn't in that post.
Thanks!