GetTime of a different timezone
#1

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

Maybe try this plugin ?
https://sampforum.blast.hk/showthread.php?tid=263711
Reply
#3

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

Is it possible to gettime and then just add to the hour variable?
Reply
#5

You can using GMT, but you need informations from player, where he live.
Reply
#6

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)