Our Scripts Vault contains many game scripts that you can use to create your own game!
- And yes, the server-time is confusing. The server is placed in US and I am from Sweden so confusing... yes. I had swedish times there for my friends before I announced about the game here. I'll change so that people can enter what timezone they are from and adjust the times everywhere based on that.
I do not know much about javascript so I'll try to find another solution. I think I would simply add a code for their timezone in the DB and then on the two pages I have the times mentioned I would check what timezone the user is from and then give them the correct time. Perhaps have some sort of function where they write in what the clock is right now and then save the difference in a DB and use it later on the two pages.
Quote from: lindhsky on March 15, 2010, 06:12:32 PMI do not know much about javascript so I'll try to find another solution. I think I would simply add a code for their timezone in the DB and then on the two pages I have the times mentioned I would check what timezone the user is from and then give them the correct time. Perhaps have some sort of function where they write in what the clock is right now and then save the difference in a DB and use it later on the two pages.That's the normal way of doing it, yeah. The most common use of javascript for this sort of thing in my experience is a simple js timer to adjust the time every second so that the displayed time is 'live' instead of being fixed at the time when the page was loaded, although I believe you could also use js to read the user's clock and display that time, bypassing server time and time zone considerations entirely - but, at that point, why bother? If the user wants to see the time on their own computer's clock, there are plenty of desktop programs they can use to display that.