Philip wrote:
> The Other Guy wrote:
>> Philip wrote:
>>> Is there an HTML function that can check the time in the computer it's
>>> running on, and output a result reflecting the difference between that
>>> time and NZ Standard, or Summer, time?
>>
>> HTML does not have functions, it only describes the layout of a page.
>>
>> You would need to use JavaScript to do this, but I'd favour just
>> specifying the times in GMT.
>>
>> The Other Guy
>
> Such is my ignorance. I take your point about GMT (or UTC) but I I'm not
> sure all my potential listeners (or even either of thhem) will be able
> to make the leap from Zulu time to whatever their local clocks say.
>
> So no I need to find out about programming in Java. This could be more
> or less fun.
>
> Philip
Its javascript, not Java
And, because I wanted to know how to do it myself I had a google round and
got this
http://www.irt.org/script/785.htm
(I'll post the lot so I can come back and read it if I need to)
Q785 How do I pass the client's local time to a server side process?
Either using a form submission:
<form name="myForm">
<input type="hidden" name="myTime" value="">
</form>
<script language="JavaScript"><!--
function padout(number) { return (number < 10) ? '0' + number : number; }
var today = new Date();
document.myForm.myTime = escape(padout(today.getHours()) + ':' +
padout(today.getMinutes()) + ':' + padout(today.getSeconds()));
//--></script>
Or as part of an image load request:
<script language="JavaScript"><!--
function padout(number) { return (number < 10) ? '0' + number : number; }
var today = new Date();
document.write('<img src="program.cgi?' + padout(today.getHours()) + ':' +
padout(today.getMinutes()) + ':' + padout(today.getSeconds()) + '"
width="1" height="1">');
//--></script>
Once you have their date you can calculate the diff between that and
localtime
HTH
--
Joey Mousepad: He's flashing his cash loaf again.
Don-Bot: How may times is that? Two or three?
Clamps: Three.
Don-Bot: All right. That's the necessary number of times. That scab is gonna
have a little 'on the job accident'.
Joey Mousepad: With all due respect Don-Bot, I don't think we should rely on
an accident happening. Let's kill him ourselves.
blog:
http://shanes.dyndns.org