Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Strange bug with timezones
03-16-2005, 04:26 PM #1
- Join Date
- Mar 2005
- Thanked 0 Times in 0 Posts
Strange bug with timezones
So here i have some strange problem. I designed a system to display specified number of lines from array. The number of lines to display is counted this way:
1. timestamp is taken when should it start displaying;
2. number of seconds is set after each additional line should be displayed.
3. total lines are counted.
here is the code:
formatDate.js is a set of functions.. similar to ones used by php
now the script has some strange behavior..
the time is set correctly, everything works fine as it should for those who are in same timezone as server. It is servertime in var unix.
text is added to array at other place in order to make it less vissible for users who looks at source. The script is set to display number of lines counted in function.
Now the time comes to start displaying lines..
For people in other timezones it doesnt display the lines... However it refreshes the page when all lines should be displayed and displays it then. But until then none of the lines displayed. (It works perfectly for people in same timezone as server and works perfectly if sets their pc clock to server timezone) Could someone explain why this happens? because i am searching for a reason more than a week now and i am going crazy about it. What influence timezone have here, because all times are servertime and none of them are usertime...
03-17-2005, 01:50 AM #2
- Join Date
- Jun 2002
- Thanked 256 Times in 252 Posts
But this is user time:Originally Posted by Rokas
var time = new Date()
You should have passed the server time in the Date constructor.