|
Posted by Toby Inkster on 11/24/46 11:45
Captain Dondo wrote:
> Given these limitations, is there a way to show a real-time, ticking
> clock?
Ah -- only just read that.
If you can afford to be a handful of seconds inaccurate, you could use PHP
to generate some Javascript like:
<script type="text/javascript">
var servertime = new Date('<?= htmlentities(date('r')) ?>');
var clienttime = new Date();
var timeoffset = servertime - clienttime;
function alertDate ()
{
var d = new Date();
d += timeoffset;
window.alert('The server date is ' + d.toString());
}
var annoyance = window.setInterval('alertDate', 20000);
</script>
That's not been tested, so it may have one or two syntax errors, but it
should give you an idea about how to proceed.
(I felt I owed you a good answer after my previous rubbish one!)
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|