Time on linux
#1

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.
Reply
#2

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

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!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)