GetTime of a different timezone - 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: GetTime of a different timezone (
/showthread.php?tid=542314)
GetTime of a different timezone -
Blademaster680 - 18.10.2014
Is it possible to get the time from a different timezone and display it as a
textdraw at the top of the player's screen?
I am wanting the server to get the timezone from Los Angeles as a live
time and then display that time as a textdraw at the top of the screen.
My gamemode is based in Los Angeles and that is why I need
a live clock with that timezone.
Thanks
Re : GetTime of a different timezone -
Chipardeur - 18.10.2014
Maybe try this plugin ?
https://sampforum.blast.hk/showthread.php?tid=263711
Re: GetTime of a different timezone -
dominik523 - 18.10.2014
I would do something like this
pawn Код:
stock GetTimeEx(timezone)
return gettime() + timezone*3600;
This would show time in different timezone from the timezone where server is.
You could also get current hour from gettime function and add timezone to it.
Re: GetTime of a different timezone -
Blademaster680 - 18.10.2014
Is it possible to gettime and then just add to the hour variable?
Re: GetTime of a different timezone -
0x41726d79 - 18.10.2014
You can using GMT, but you need informations from player, where he live.
Re: GetTime of a different timezone -
Blademaster680 - 18.10.2014
Quote:
You can using GMT, but you need informations from player, where he live.
|
Problem is I need the whole server to be on the same timezone... which needs to be UTC-08:00.
Re: GetTime of a different timezone -
austin070 - 18.10.2014
Quote:
Originally Posted by Blademaster680
Problem is I need the whole server to be on the same timezone... which needs to be UTC-08:00.
|
Well GetTime() takes the time from the computer that the server is running on. If the server's computer is in -8, everyone will see the correct time. Otherwise, I would subtract or add however many hours necessary to meet the time of UTC -8 if you don't want to use the plugin mentioned above.