Displaying Live Server time

I have a JSP page that i want to display a live display of the servers date and time (hours minute seconds)what would be the best way about doing this?thanks kindlyTom
[195 byte] By [twunchera] at [2007-11-27 8:09:22]
# 1
Make a new Date object (which will default to the current time) and then use java's SimpleDateFormat to format the date There are plenty of examples online.
den2681a at 2007-7-12 19:52:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
what i mean by a live time, is more like a running clock instead of returning the time of when the page was last refreshed
twunchera at 2007-7-12 19:52:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
The server's live time, displayed in which timezone?I think the better solution would be to set the time on the page from the server's time, but then leave it to the client to keep track of the time elapsed since then (ie make it a javascript clock)
evnafetsa at 2007-7-12 19:52:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
well the server is located in london so it will be GMT i want to get the time from the server and display it on the website as a clock which is constantly updating by the secondany idea?
twunchera at 2007-7-12 19:52:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

A quick google for javascript clock comes up with something:

http://www.google.com/search?hl=en&q=javascript+clock&meta=

http://www.javascript-page.com/clock.html

The only thing that would have to change is to set the date as the server date, rather than the client date.

var tDate = new Date(<%= System.currentTimeMillis() %>);

This would be set to the server time at the time of serving the page. It would probably take a few seconds to transmit/render on the client machine.

How accurate do you need this clock to be?

evnafetsa at 2007-7-12 19:52:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...