Question about Timestamp.
#1

How do I get another players timezone? Take for instance, I banned a player for two hours, Server is hosted in UK, and they are somewhere with GMT + 1 That means they'll be unbanned in an hour instead of two....How do I get the timestamp of an actual player?
Reply
#2

No, they won't. gettime() always return the server time.
Reply
#3

Ohhh yeahhhhh.... Makes sense. Thank you.
Reply
#4

Quote:
Originally Posted by Dokins
Посмотреть сообщение
Ohhh yeahhhhh.... Makes sense. Thank you.
You could always base there location off of geo-ip and use the timezone of the region of that area and adjust gettime() accordingly for that ban.
Reply
#5

That wouldn't work, I'm afraid. I forgot that gettime only uses the server time, so therefore it's comparing itself and not the players time. Thanks anyway, and thanks to Vince.
Reply
#6

Quote:
Originally Posted by Dokins
Посмотреть сообщение
That wouldn't work, I'm afraid. I forgot that gettime only uses the server time, so therefore it's comparing itself and not the players time. Thanks anyway, and thanks to Vince.
how would it not work? if you use geo-ip to know a user is in say GMT+1 and the server is in GMT+2 why can't you adjust the gettime() result by one hour? its just math some simple math.
Reply
#7

It's based off the server time, not the player time, so when a player is banned and logs back in, the timestamp will be the same one in the server, not on the player so if I adjust that per player then it's going to adjust the actual server timestamp.
Reply
#8

oh, oh, oh, oh, I see what you meant by the question now. You were wondering if gettime() would return the players time or not. My bad, ignore me.
Reply
#9

It was actually my own fault for being dumb and having a bad memory aha!

Gettime always returns the servertime, so no matter where in the world you are, you won't be unbanned until the server time > timestamp.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)