Question about Timestamp. -
Dokins - 26.03.2014
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?
Re: Question about Timestamp. -
Vince - 26.03.2014
No, they won't. gettime() always return the server time.
Re: Question about Timestamp. -
Dokins - 26.03.2014
Ohhh yeahhhhh.... Makes sense. Thank you.
Re: Question about Timestamp. -
DeStunter - 26.03.2014
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.
Re: Question about Timestamp. -
Dokins - 26.03.2014
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.
Re: Question about Timestamp. -
DeStunter - 26.03.2014
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.
Re: Question about Timestamp. -
Dokins - 26.03.2014
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.
Re: Question about Timestamp. -
DeStunter - 26.03.2014
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.
Re: Question about Timestamp. -
Dokins - 26.03.2014
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.