Skip to main content
GameDev.net gamedev.net
🔒 Locked

[web] Web Dev Question....

Started by Rob Loach Jul 10, 2004 at 7:58 AM 7 replies 900+ views
Spintwo
Spintwo
What SSL are you using? PHP, ASP?
Spintwo
Spintwo
Well, if you're using the UNIX timestamp, why don't you just
$servertime=time()-120;  /*this will set the time 2 min ahead because 120s=2 mins*/


And add or subtract time according to what you need?

[Edited by - Charles Hwang on July 10, 2004 2:30:38 PM]
monkey_32606
monkey_32606
Do you mean 2 minutes?
Quote: Michael TanczosCut that shit out. You shouldn't be spying on other people.. especially your parents. If your dad wanted to look at horses having sex with transexual eskimo midgets, that's his business and not yours.
Spintwo
Spintwo
Quote:
Original post by monkey_32606
Do you mean 2 minutes?


yes..lol.
evolutional
evolutional
I'm guessing that you'll need permission to change the server time, if it's your own server then fine - but if you have hosting bought from another company then I doubt these suggestions will work.
Spintwo
Spintwo
My suggestion doesn't conflict with any of that.. time() will just get you the time referring to the server location so if the server was in california and Rob was in colorado and wanted colorado time, he could do the -3600, translate it, then display it in human readable form. I don't see where the server login comes into play here.
markr
markr
time() gives you the unix time in seconds since 1969, Greenwich. This is not human readable, but fortunately is time zone independent.

localtime() converts the time() value into a bunch of numbers containing the year, month, day etc, and will do so according to the local time zone the admin has set. You can also use gmtime() to do the same for Greenwich time.

My advice is if you're making a multi-timezone app, get the time from Greenwich then add / subtract as necessary on a per-user basis. Or be cleverer if you want daylight saving done automatically.

In any case, if you want the actual server clock changing, you should speak to the admin. It is however unlikely that it's actually wrong, just in a different TZ, that's ok. Most servers should have their clocks sunc* over the internet.

Mark

* sunc is obviously the past participle of sync, the same way as sunk is to sink.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.