Author: evolver » Wed Nov 22, 2006 4:32 pm
57 replies for a countdown block, whaw...
I have been watching this topic with interest, but I see you struggling with the timezones...
Very logical, if you are using PHP to read the time because PHP doesn't read the usertime, only the servertime.
So the only way to get it right for every user by PHP would be by timezonecalculation for every user...
All this is unnecessary...
Javascript is better for this situation, and I use one...
Different from PHP, javascript will use the visitors computertime instead of servertime...
No need for special formulas to make it suitable with different timezones, and it will save your server some processing too...
...and with no extra tables to add in your database...
Can't be more easy than this:
Just make a block with HTML and place this code in it:
(It's javascript, so I've placed it as a downloadable compressed textfile)
The only problem would be language, if you have more languages on your forum.
- Attachments
-
- countdown_javascript.rar
- Javascript Countdown
Still xx days, xx hours, xx minutes and xx seconds before Newyear.
- (524 Bytes) Downloaded 219 times
Last edited by
evolver on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
Always remember you're unique, just like everyone else.
We are born naked, wet and hungry. Then things get worse.
Don't take life too seriously, you won't get out alive.