Pergunta

How can I make the clocks on http://torwiki.com/page/User:Technical_13/SandBox#Dynamic_Clock dynamic to show the actual current time in multiple time zones... I am an administrator, so I have access to MediaWiki:common.js, which is activated. I have read tutorials to show a single clock, but how would a make it work with multiple clocks? I want to be able to create a template that will allow me to define the timezone, and have it display the current time in that zone. I could wrap it in a <span> with an id or name to identify the timezone I want, but how do I make it work for multiple clocks. Keep in mind, that using MediaWiki style wiki, I can not put any javascript calls in-line for each instance.

Foi útil?

Solução

There are a million JavaScript clock scripts on line. It sounds like your real issue is that you want it to show user local time, not server time -- but you've forgotten that the JavaScript runs in the user's browser. Calling Date() will automagically give you the user's local time.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top