SA-MP Forums Archive
Problem with GetTime. - 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: Problem with GetTime. (/showthread.php?tid=494253)



Problem with GetTime. - phoon - 12.02.2014

I made a simple Time system but GetTime returns time from the computer that server is hosted.
Now the time is not correct because the computer is from another country.

Is there anyway to make a function or script that returns the correct time for players.


Re: Problem with GetTime. - Pottus - 12.02.2014

Easy way to do that.

gettime + (3600*(ServerGMT - HostGMT))

Server Host Adjustment
7------5-----(2*3600)
5------7-----(-2*3600)


Re: Problem with GetTime. - phoon - 12.02.2014

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
Easy way to do that.

gettime + (3600*(HostGMT - ServerGMT))

Host
I'm sorry. I didn't understood.
Beg for a explanation, please?


Re: Problem with GetTime. - Pottus - 12.02.2014

Your just offsetting based on GMT find the GMT of your host and the one you want for your server then just apply the formula it will give you the correct timestamp based on the timezone of your choosing.